Skip to main content

S2S Payment with Save Card

Process a Server-to-Server card payment and store the card for later charges.

Use this when the customer is paying with a raw card for the first time and you want to keep a cardToken for future payments. customerToken is required when saveCard is true. After a successful save, list tokens with Get Saved Card Tokens.

Endpoint Information

Name: S2S Payment with Save Card
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

{
"reference": "test26080001",
"customerToken": "{{customerToken}}",
"currency": "USD",
"amount": "100.00",
"ttl": 5,
"tagName": "Tag",
"webhookUrl": "https://example.test",
"merchantAccountId": "{{merchantAccountId}}",
"card": "4111111111111111",
"secret": "123",
"expiryDate": "{{expiry_date}}",
"cardName": "TEST TEST",
"saveCard": true,
"customerBrowserUserAgent": "Mozilla 52.0",
"customerIP": "127.0.0.1"
}

Key Parameters

ParameterTypeRequiredDescription
referencestringYesUnique payment reference (10+ characters, no special characters)
customerTokenstringYesCustomer token. Required when saving a card
currencystringYesISO 4217 currency code
amountstringYesTransaction amount
merchantAccountIdstringYesYour merchant account ID
cardstringYesFull card number (PAN)
secretstringYesCVV/CVC
expiryDatestringYesCard expiry (MM/YY)
cardNamestringYesCardholder name
saveCardbooleanYesSet to true to store the card and return a cardToken
customerBrowserUserAgentstringYesBrowser user agent (used for 3DS)
customerIPstringYesCustomer IP address (used for 3DS)
ttlnumberNoTime to live in minutes
tagNamestringNoOptional tag for the payment
webhookUrlstringNoURL for payment status notifications

Response

Success Response (3DS redirect)

When the issuer requires 3D Secure, container_type is redirect and redirect_to contains the ACS URL. Send the customer to that URL to complete authentication.

{
"success": true,
"message": "Payment Request Processing",
"data": {
"success": true,
"reference": "12414312-14313212-121432312-132312321",
"reference_id": "12312312-132312132-132131312-1312313",
"container_type": "redirect",
"redirect_to": "https://api.sandbox.checkout.com/sessions-interceptor/sid_sdjhbfiuwye97y24r86gy26823",
"errors": []
}
}

Response Fields

FieldTypeDescription
data.referencestringPayment reference
data.reference_idstringInternal reference ID
data.container_typestringredirect when 3DS is required
data.redirect_tostring3DS / session URL. Redirect the customer here when not null

Next steps

  1. Get Saved Card Tokens — retrieve the stored cardToken
  2. S2S Payment using Card Token — charge the saved card