API for topping up account balances.
POST /accounts/{LookupValue}/applycredit?LookupType={LookupType}
Updates the specified account's balance, available credit and/or packaged balances for the specified LookupValue
and LookupType
.
See the Payment Request Object.
If LookupType
is not specified, then LookupValue
is assumed be an account number (if quoted) and an Account ID if not quoted.
Valid values for LookupType
:
LookupValue={ANI}
and LookupType=alias
ANI
.This URL can be used used to update a subscriber account's balance, available credit and/or packaged balances.
It can be used to update the balance directly, or can be used to submit credit/debit card charges to the Payment Gateway Server for processing.
If successful, the account's balance will be updated and a billing CDR will be created.
Accounts API
API Response Format
{
"UsePaymentGateway": false,
"UpdateLastCreditOrDebitDateTime": true,
"CreditType": 0,
"CreditInfo": {
"BillingDescription": "",
"BillingDetail": "",
"Quantity": 0,
"AccountCreditAmount": 0,
"PackagedCreditUpdate": false,
"PackagedCreditAmounts":
[
0,
0,
0,
0,
0
],
"PaymentInfo": {
"PaymentGatewayId": 0,
"PaymentAction": 0,
"CardCVV2Data": "",
"CardExpMonth": "",
"CardExpYear": "",
"CardNumber": "",
"CustomerFullName": "",
"CustomerFirstName": "",
"CustomerLastName": "",
"CustomerAddress": "",
"CustomerCity": "",
"CustomerState": "",
"CustomerZip": "",
"CustomerCountry": "",
"CustomerEmail": "",
"CustomerPhone": "",
"CustomerId": "",
"CustomerInvoiceNumber": "",
"ChargeAmount": 0
}
}
}
Field Name | Type | Description |
---|---|---|
UsePaymentGateway | bool | When 'true', uses the PaymentInfo properties to specify which payment gateway should be used, along with the subscriber's credit card information. |
UpdateLastCreditOrDebitDateTime | bool | When 'true', updates the account statistics for LAST_CREDIT_DATE_TIME or LAST_DEBIT_DATE_TIME. Positive amounts are considered credits, and negative amounts are considered debits. |
CreditInfo.CreditType | int | The type of credit being applied. 0=Account Credit (This is a general account credit that is being applied to the account, perhaps for a discount for service, a usage reversal or a correction to a user's account.) 1=Payment (This entry is used for payments or recharges that are being made to the account.) 2=Refund (This entry is used to apply refunds to an account for unused service upon cancellation or for overcharges made to the account.) |
CreditInfo.BillingDescription | string | This is an overall description of the charge being applied to the current account. The entry placed here will be displayed in the 'Description' column of the account's billing record. |
CreditInfo.BillingDetail | string | This is a detailed description of the charge being applied to the current account. The entry placed here will be displayed in the 'Detail' column of the account's billing record. |
CreditInfo.Quantity | currency | The quantity that will displayed in the 'Quantity' column of the account's billing record. |
CreditInfo.AccountCreditAmount | currency | The amount that will be applied to the account balance if the transaction is successful. If UsePaymentGateway = true , then this amount can be different from `PaymentInfo.ChargeAmount'. |
CreditInfo.PackagedCreditUpdate | bool | When 'true' the CreditInfo.PackagedCreditAmounts will be applied. |
CreditInfo.PackagedCreditAmounts | int array | The packaged credits that will be applied to the account. Each element's position corresponds to the packaged balance (1-5) that will be updated. |
PaymentInfo.PaymentGatewayId | int | The Id of the Payment Gateway to use when applying charges via the Payment Gateway Server. |
PaymentInfo.PaymentAction | int | 1 = Sale 2 = Pre Authorization 3 = Post Authorization 4 = Credit 5 = Void |
PaymentInfo.CardCVV2Data | string | Card Verification Code |
PaymentInfo.CardExpMonth | string | Card expiration month in MM format |
PaymentInfo.CardExpYear | string | Card expiration year in YY format. |
PaymentInfo.CardNumber | string | Card number. |
PaymentInfo.CustomerFullName | string | Customer's full name on card. |
PaymentInfo.CustomerFirstName | string | Customers first name. |
PaymentInfo.CustomerLastName | string | Customer's last name. |
PaymentInfo.CustomerAddress | string | Customer's billing street address. |
PaymentInfo.CustomerCity | string | Customer's billing city. |
PaymentInfo.CustomerState | string | Customer's billing State. |
PaymentInfo.CustomerZip | string | Customer's billing Zip or Postal code. |
PaymentInfo.CustomerCountry | string | Customer's billing Country. |
PaymentInfo.CustomerEmail | string | Customer's E-mail address. |
PaymentInfo.CustomerPhone | string | Customer's Phone number. |
PaymentInfo.CustomerId | string | Optional Id used to identify the customer. |
PaymentInfo.CustomerInvoiceNumber | string | Optional invoice number. |
PaymentInfo.ChargeAmount | currency | The amount that will be charged to the customer's credit card in 0.00 format. This may be a different value from CreditInfo.AccountCreditAmount . |