S2S Payment using Card Token
Charge a previously saved card by sending cardToken instead of the full PAN.
Get cardToken from Get Saved Card Tokens. Still send secret (CVV) and the customer details. To send both cardToken and customerToken with saveCard, see S2S Payment with Card Token and Customer Token.
Endpoint Information
Name: S2S Payment using Card Token
Method: POST
URL: {{base_url}}/api/v1/payment/process-transaction
Authentication
Type: Basic Auth
- Username: App Key
- Password: Secret Key
Request Body
Content-Type: application/json
{
"firstName": "Test",
"middleName": "", // optional
"lastName": "Customer",
"reference": "{{$guid}}",
"email": "[email protected]",
"dob": "1990-01-01", // optional but format must be yyyy-mm-dd if present
"contactNumber": "+12345678",
"address": "test",
"country": "SE",
"state": "test",
"city": "test",
"zipCode": "1212",
"currency": "USD",
"amount": "110",
"webhookUrl": "{{webhookUrl}}", // optional, max 255 characters
"merchantAccountId": "{{merchantAccountId}}",
"cardToken": "{{cardToken}}",
"secret": "123",
"customerBrowserUserAgent": "Mozilla 52.0",
"customerIP": "127.0.0.1"
}
Do not send card, expiryDate, or cardName when paying with cardToken.
Key Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
firstName | string | Yes | Customer's first name |
middleName | string | No | Customer's middle name |
lastName | string | Yes | Customer's last name |
reference | string | Yes | Unique payment reference |
email | string | Yes | Customer's email address |
dob | string | Yes | Date of birth (YYYY-MM-DD) |
contactNumber | string | Yes | Contact number with country code |
address | string | Yes | Customer address |
country | string | Yes | Country name or ISO 3166-1 alpha-2 code |
state | string | Yes | State/province |
city | string | Yes | City |
zipCode | string | Yes | Postal/ZIP code |
currency | string | Yes | ISO 4217 currency code |
amount | string | Yes | Transaction amount |
webhookUrl | string | No | URL for payment status notifications. Max 255 characters |
merchantAccountId | string | Yes | Your merchant account ID |
cardToken | string | Yes | Saved card token from Get Saved Card Tokens |
secret | string | Yes | CVV/CVC |
customerBrowserUserAgent | string | Yes | Browser user agent (used for 3DS) |
customerIP | string | Yes | Customer IP address (used for 3DS) |
Response
Success Response (3DS redirect)
When 3DS is required, redirect the customer to redirect_to.
{
"success": true,
"message": "Payment Request Processing",
"data": {
"success": true,
"reference": "6be4b237-ca3f-47c2-890b-411b7a54e121",
"reference_id": "6be4b237-ca3f-47c2-890b-411b7a54e121",
"container_type": "redirect",
"redirect_to": "https://api.sandbox.checkout.com/sessions-interceptor/sid_rl64ulqb5v6ytnjorexz55rwfm",
"errors": []
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
data.reference | string | Payment reference |
data.reference_id | string | Internal reference ID |
data.container_type | string | redirect when 3DS is required |
data.redirect_to | string | 3DS / session URL. Redirect the customer here when not null |