Skip to main content
Vindicia Knowledge Center




The grantCredit method adds credit to an Account object. With credit available to an Account, you can conduct a one-time transaction for the Account. If the Account is associated with an AutoBill, and if the AutoBill has no associated credit, Vindicia Subscribe can draw credit down from the Account to sustain the AutoBill.

Specify credit you wish to grant to the Account as a Credit object. Time-based credit cannot be granted to an Account.

See the Credit Subobject, and the TimeInterval Subobject, for more information.

See Credit Grants and Gift Cards in the Vindicia Subscribe Programming Guide for more information on working with credit.


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.

account: the Account object to which you wish to grant credit. Use the merchantAccountId or VID to identify the object.

credit: a Credit object specifying the amount and type of credit you wish to grant to the Account.

note: an optional memo regarding the credit grant.


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

account: the Account object to which you granted credit. This object contains the updated array of Credit objects.


In addition to those listed in Standard Return Codes, this call returns:

Return Code

Return String


One of the following:

  • Account not found.
  • Failed to translate credit error-description.
  • Failed to grant credit error-description.
  • Failed to save Account after granting credit.
  • Failed to reload Account after granting credit error-description.
  • Time interval credit cannot have amount 0.


// to grant credit to an account

$acct = new Account();

// account id for an existing customer


$tok = new Token();

// specify id of an existing token type.
// assumption here is that you have already created
// a Token object with this id


$tokAmt = new TokenAmount();

$cr = new Credit();

// Now make the SOAP API call to grant credit to the acct

$response = $acct->grantCredit($cr);

if ($response['returnCode'] == 200) {

// Credit successfully granted to the account

$updatedAcct = $response['data']->account;
$availableCredits = $updatedAcct->getCredit();
$availableTokens = $availableCredits->getTokenAmounts();

print "Available token credits: \n";
foreach($availableTokens as $tkAmt) {

print "Token type: " . $tkAmt->getMerchantTokenId() . " ";
print "Amount: " . $tkAmt->getAmount() . "\n";


else {

// Error while granting credit to the account

print $response['returnString'] . "\n";


For Users

Learn More
For Users

Vindicia Subscribe Features

Learn More
Vindicia Subscribe Features
Back to Top