> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AutoBill.fetchRemainingPaymentDetails

The `fetchRemainingPaymentDetails` method returns `AutoBill` information after the most recent payment.

**Note:** If an `AutoBillItem` has a price basis of `Included`, `fetchRemainingPaymentDetails` will return `undefined`.

## Input

*srd*: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a `method` call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.

Some fields are required, either practically or in the WSDL, and will be returned regardless of the *srd*. A null *srd* returns the complete response.

*autobill*: the `AutoBill` object to query.

## Output

*return*: an object of type `Return` that indicates the success or failure of the call.

*autobillRemainingBalanceInSet*: the balance remaining on the `AutoBill`.

*billingPlanRemainingBalanceInSet*: the balance remaining on the `BillingPlan`.

*billingPlanRemainingPaymentsInSet*: the number of payments remaining on the `BillingPlan`.

*autobillItemRemainingPaymentDetails*: an array of `PaymentDetails` objects, listing information about the payment due to each `AutoBillItem`.

* *autobillItemVid*: the Vindicia unique name (VID) for the `AutoBillItem`.
* *merchantAutoBillItemId*: the unique identifier for this `AutoBillItem` object.
* *merchantProductId*: the unique identifier for the product. If you track your products internally by SKU, use the SKU as your `merchantProductId`, to allow you to map your local records to Subscribe `Transactions` that have this `AutoBillItem` as a line item.
* *productVid*: the Vindicia unique name (VID) for the `Product`.
* *remainingBalanceInSet* :the balance remaining in the `AutoBill` for the `AutoBillItem`.
* *remainingPaymentsInSet*: the number of payments remaining in the AutoBill for the `AutoBillItem`.

## Returns

This method returns the codes listed in [The Return Object](The_Return_Object).

## Example

```

$rc = $autobill_factory->fetchRemainingPaymentDetails($autobill);
// check response in $rc
print "AutoBill remaining balance is ", 
$rc->{autobillRemainingBalanceInSet}, "\n";
print "There are ", $rc->{billingPlanRemainingPaymentsInSet}, 
" payments remaining.\n";
$pd_ar = $rc->{autobillItemRemainingPaymentDetails};
foreach ($pd_ar as $item_data)
{
   print "Payment details for product ", 
      $item_data->merchantProductId, ":\n";
   print " Item remaining balance is ", 
      $item_data->remainingBalanceInSet, ".\n";
   print " There are ", $item_data->remainingPaymentsInSet, 
      " payments left.\n";
}
```

**Parent topic:**[AutoBill Methods](../topics/AutoBill_Methods)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.