Skip to main content

Recurring Transaction

Recurring payments are commonly used to create new transactions based on already stored cardholder information from previous Authentication operations.

API Endpoint

Request URL:      {{CHECKOUT_HOST}}/api/v1/payment/reсurring
Request Method: POST
Request Body: JSON

Request Parameters

ParameterTypeMandatory, LimitationsDescription
merchant_keyStringRequiredKey for Merchant identification
Example: xxxxx-xxxxx-xxxxx
recurring_init_trans_idStringRequiredTransaction ID of the primary transaction in the Payment Platform
Example: dc66cdd8-d702-11ea-9a2f-0242c0a87002
recurring_tokenStringRequiredRecurring token
Example: 9a2f-0242c0a87002
schedule_idStringOptionalSchedule ID for recurring payments
hashStringRequiredSpecial signature to validate your request to Payment Platform.
For details, click here
orderObject
numberStringRequired
Not blank
max: 255
[a-zA-Z0-9-]
Order ID
Example: order-1234
amountFloatRequired
Not blank
Greater then 0
0-9
max: 255
Product price. Format: XX.XX
Pay attention that amount format depends on currency exponent.
If exponent = 0, then amount is integer (without decimals). It used for currencies: CLP, VND, ISK, UGX, KRW, JPY.
If exponent = 3, then format: xx.xxx (with 3 decimals). It used for currencies: BHD, JOD, KWD, OMR, TND.
Example: 0.19
descriptionStringRequired
min: 2 max: 1024
[a-zA-Z0-9!"#$%&'()*+,./:;&@]
Product name
Example: Very important gift - # 9

Response Parameters

ParameterTypeMandatory, LimitationsDescription
merchant_keyStringRequiredTransaction status
Example: PREPARE, SETTLED, PENDING, 3DS, REDIRECT, DECLINE, REFUND, REVERSAL, CHARGEBACK
reasonStringOptionalDecline reason translation for unsuccessful payment.
It displays only if the transaction is unsuccessful
Example: The operation was rejected. Please contact the site support
payment_idStringRequired
Up to 255 characters
Transaction ID (public)
Example: dc66cdd8-d702-11ea-9a2f-0242c0a87002
dateStringRequired
Format: YYYY-MM-DD hh:mm:ss
Transaction date
Example: 2020-08-05 07:41:10
schedule_idStringOptionalSchedule ID for recurring payments
orderObject
numberStringRequired
max: 255
Order ID
Example: order-1234
amountStringRequired
Format: XX.XX
Product price (currency will be defined by the first payment)
Example: 0.19
currencyStringRequired
3 characters
Currency
Example: QAR
descriptionStringRequired
max: 1024
Product name
Example: Very important gift - # 9

Examples

Request
Recurring (settled)
curl --location -g --request POST '{{CHECKOUT_HOST}}/api/v1/payment/reсurring' \
--data-raw \
'{
"merchant_key": "xxxxx-xxxxx-xxxxx",
"order":{
"number": "order-1234",
"amount": "0.19",
"description": "very important gift"
},
"customer": {
"name": "John Doe",
"email": "success@gmail.com"
},
"recurring_init_trans_id": "dc66cdd8-d702-11ea-9a2f-0242c0a87002",
"recurring_token": "9a2f-0242c0a87002",
"schedule_id": "57fddecf-17b9-4d38-9320-a670f0c29ec0",
"hash": "{{session_hash}}"
}'
Recurring (declined)
curl --location -g --request POST '{{CHECKOUT_HOST}}/api/v1/payment/reсurring' \
--data-raw \
'{
"payment_id": "1f34f446-fc45-11ec-a50f-0242ac120004",
"date": "2022-07-05 09:30:34",
"status": "decline",
"reason": "Declined by processing.",
"order": {
"number": "order-1234",
"amount": "3.01",
"currency": "QAR",
"description": "bloodline"
},
"customer": {
"name": "John Doe",
"email": "success@gmail.com"
}
}'
Response
Status Settled
{
"status": "settled",
"payment_id": "dc66cdd8-d702-11ea-9a2f-0242c0a87002",
"date": "2020-08-05 07:41:10",
"schedule_id":"57fddecf-17b9-4d38-9320-a670f0c29ec0",
"order": {
"number": "order-1234",
"amount": "0.19",
"currency": "QAR",
"description": "very important gift"
}
}
Status Declined
{
"status": "declined",
"reason": "declined by processing",
"payment_id": "dc66cdd8-d702-11ea-9a2f-0242c0a87002",
"schedule_id":"57fddecf-17b9-4d38-9320-a670f0c29ec0",
"date": "2020-08-05 07:41:10",
"order": {
"number": "order-1234",
"amount": "0.19",
"currency": "QAR",
"description": "very important gift"
}
}