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

# billTransactions

Submits transactions to Vindicia Retain for processing. This call is required to implement Retain use case [5-8-01](/portal/retainUseCases/topics/5801_submitFailedTransactions).

Use `fetchBillingResults` to retrieve final results of Vindicia Retain processing on transactions submitted via `billTransactions`; see `[fetchBillingResults](fetchBillingResults)` for details.

## Input

*transactions*: an array of [Transaction](transaction_data_members) objects. For a given transaction that has failed at your payment provider, submit to Vindicia Retain the final failed attempt from your billing system only.

**Note:** Do not populate the VID field in any new transaction submitted with this method. Vindicia Retain populates this data member in the `[fetchBillingResults](fetchBillingResults)` call.

## Output

*return*: an object of type `[Return](return_data_members)` that indicates the success or failure of the call.

*response*: an object of type [`TransactionValidationResponse`](TransactionValidationResponse), which includes the ID of the Transaction returning an error.

**Note:** An empty `TransactionValidationResponse` object indicates that the call succeeded without error. For more information, see [TransactionValidationResponse Values](TransactionValidationResponse).

## Returns

This method returns the codes listed in [Retain Return Codes](retain.return_codes).

## Example

```

$tx = new Transaction();
$tx->setTimestamp('2012-09-11T22:34:32.265-4:00');
$tx->setAmount('9.90');
$tx->setCurrency('USD');
$tx->setStatus('Failed');
$tx->setDivisionNumber('54321');
// Merchant Transaction ID must be unique for each new
// transaction you want Vindicia to process.
$tx->setMerchantTransactionId('TxPrfx123');
// Merchant Subscription ID should be unique for each new
// transaction-subscription you wish Vindicia to process.
$tx->setSubscriptionId('AbPrfx456');
$tx->setBillingInterval('Yearly');
$tx->setPreviousBillingDate('2011-09-11');
$tx->setPreviousBillingCount('24');
// Merchant Customer ID should be unique for each unique Customer.
$tx->setCustomerId('McPrfx789');
$tx->setPaymentMethodId('PmPrfx012');
$tx->setPaymentMethodIsTokenized(false);
$tx->setCreditCardAccount('4111111111111111');
$tx->setCreditCardExpirationDate('20121212');
$tx->setAccountHolderName('Calvino Hobbes');
$tx->setBillingAddressLine1('Suite 200');
$tx->setBillingAddressLine2('23 George Street');
$tx->setBillingAddressCity('Larkspur');
$tx->setBillingAddressDistrict('CA');
$tx->setBillingAddressPostalCode('94964');
$tx->setBillingAddressCountry('US');
$nv1 = new NameValuePair();
$nv1->setName('CriminalOffense');
$nv1->setValue('Wire Fraud');
$nv2 = new NameValuePair();
$nv2->setName('Sentence');
$nv2->setValue('25 years');
$tx->setNameValues(array{$nv1, $nv2});
$tx->setAuthCode('110');
$select = new select();
$ret = $select->billTransactions(array{$tx});
if($ret['returnCode'] == 200)
{
    $failedTransactions = $ret['response'];
    if($failedTransactions && (sizeof($failedTransactions) > 0))
    {
        foreach ($failedTransactions as $transaction)
        {
            //Evaluate Transaction failure response here.
        }
    }
}
    else
    {//Handle error condition.
}
```

**Parent topic:**[Vindicia Retain Methods](../topics/vindicia_retain_methods)


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