Skip to main content

Charge a tokenized recurring payment

Use this endpoint to charge a follow-on recurring payment against a saved token.

Endpoint summary

Path: /tokenization/recurring
Method: POST
Content-Type: application/json

Request parameters

ParameterTypeMandatoryDescription
merchantIdStringMMerchant identifier
userIdString(56)MMerchant's user identifier, value is case sensitive
tokenIdNumberMToken identifier
reasonStringMRecurring reason
amountNumber(9,2)MRecurring amount
merchantReferenceString(64)MAn unique reference to identify this recurring order, different from the sale merchantReference
parentOrderIdNumberMOrder ID which is returned from response of API Sale: /tokenization/sale
callbackUrlObjectO 
callbackUrl.successStringOAn URL to redirect after successful payment
callbackUrl.failStringOAn URL to redirect after failed payment
callbackUrl.cancelStringOAn URL to redirect when payment is cancelled
callbackUrl.notifyStringOAn API URL in merchant's backend to receive notification
note
  • You must set isRecurring: true in the original Charge a tokenized payment call and save the returned order.id as parentOrderId for subsequent recurring charges.
  • Use a unique merchantReference for each recurring charge; it must differ from the original sale reference.

Request example

{
"request": "{\"merchantId\":3,\"userId\":\"user1\",\"tokenId\":\"436\",\"merchantReference\":\"merRef1656991803097\",\"amount\":30,\"parentOrderId\":5798}",
"signature": "<signature-generated-for-this-exact-payload>"
}

Response parameters

ParameterTypeMandatoryDescription
responseCodeStringMPayment Gateway response code
messageStringMPayment Gateway response message
orderObjectM 
order.idNumberMOrder identifier
order.merchantIdNumberMMerchant identifier which own this order
order.merchantReferenceStringMYour reference for the order
order.currencyStringM3-Letters ISO currency code of the order
order.amountNumberMOrder amount
order.netAmountNumberMNet amount of the order
order.cardTypeStringMCard type of the order
order.emailStringMCustomer's email if provided
order.createTimeDatetimeMTimestamp when the order is created. Maintained by the Payment Gateway
order.updateTimeDatetimeMTimestamp when the order is last updated. Maintained by the Payment Gateway
order.statusStringMStatus of the order. Maintained by the Payment Gateway
order.recurringBooleanMFlags the order is a recurring order or not
transactionObjectM 
transaction.idNumberMTransaction identifier for the recurring transaction
transaction.merchantIdNumberMMerchant identifier which own this transaction
transaction.typeStringMTransaction type
transaction.amountStringMTransaction amount
transaction.statusStringMStatus of the transaction. Maintained by the Payment Gateway
transaction.maskedPanStringMMasked card number of the recurring transaction if supported by the payment method
transaction.stanStringMSystem trace audit number for the transaction

Response example

{
"responseCode": "0000",
"message": "Success",
"order": {
"id": 5803,
"merchantId": 3,
"merchantReference": "merRef1656991803097",
"currency": "USD",
"amount": 30,
"netAmount": 30,
"cardType": "VISA",
"createTime": "2022-07-05T03:30:03.709+00:00",
"updateTime": "2022-07-05T03:30:03.709+00:00",
"status": "SUCCESS",
"recurring": true
},
"transaction": {
"id": 3974,
"merchantId": 3,
"type": "SALE",
"amount": 30,
"currency": "USD",
"status": "SUCCESS",
"maskedPan": "470534XXXXXX8101",
"stan": "3974"
}
}