Skip to content
API DocsDocs

Initiating a Card Payment

9 min readUpdated Aug 18, 2025

#POST /api/v1/payments/card

Use this endpoint to initiate a new card payment transaction. This will charge a customer’s card for a
specified amount. The request must include all required payment details as described below.

#Request Body Parameters

The following JSON fields are required when initiating a card payment:

FieldTypeRequiredDescription
requestIdStringYesUnique ID for the payment request. Used for idempotency (to prevent duplicate processing) and traceability.
midStringYesMerchant account ID that the transaction will be associated with.
cardObject (Card Object)YesCard information for the payment. See Card Object for details.
amountStringYesTransaction amount as a string. It must be a valid decimal number (e.g., "10", "10.0", or "10.00"), representing the actual amount in major units (e.g., dollars, not cents). Values with more than two decimal places will be automatically rounded.
currencyStringYesCurrency code in ISO 4217 format (e.g., "USD", "EUR").
langStringYesLanguage code for localizing payment pages or messages (e.g., "en", "fr").
callbackUrlStringRequired in 3D Secure flowURL on your server to receive the transaction status webhook. Required if 3D Secure is possible.
Refer to the Webhook Callback Behavior page.
successRedirectUrlStringRequired in 3D Secure flowURL to redirect the customer after a successful 3D Secure authentication.
failureRedirectUrlStringRequired in 3D Secure flowURL to redirect the customer after a failed 3D Secure authentication.
billingDetailsObject BillingDetailsYesCustomer billing info (name, address, etc.). See BillingDetails Object for fields.
orderObject (Order Object)YesOrder details (e.g., order ID, description, site). See Order Object.
deviceObject (Device Object)YesDevice and browser info for fraud checks and 3DS. See Device Object.
kycVerifiedBooleanNoFlag indicating if the customer has passed KYC (Know Your Customer) verification.
previousPaymentCountLong (int64)NoNumber of previous payments made by this customer.
metadataObjectNoAdditional metadata as key-value pairs for custom context or internal use.

Card Object

The card object contains the cardholder and card details needed to process the transaction.

FieldTypeRequiredDescription
numberStringYesCard number (PAN) as a numeric string (no spaces or dashes).
cardHolderNameStringNoCardholder’s name as printed on the card. (Optional but recommended for recordkeeping.)
expMonthStringYesCard’s expiration month in MM format (e.g., "08" for August).
expYearStringYesCard’s expiration year in YYYY format (e.g., "2027").
cvvStringYesCard verification code (CVV/CVC), typically a 3- or 4-digit number on the card.
requestThreeDSecureBooleanYesWhether to request 3D Secure authentication for this transaction. Set to true to require 3DS if available.
Even if set to false, some card issuers will still require 3DS.

BillingDetails Object

The billingDetails object contains billing and personal information about the customer, used for
payment processing and risk checks.

FieldTypeRequiredDescription
externalUserIdStringYesAn identifier for the customer in your system (useful for reconciliation or linking transactions to user accounts).
firstNameStringYesCustomer’s first name.
lastNameStringYesCustomer’s last name.
address1StringYesBilling address line 1 (street address or P.O. box).
cityStringYesBilling city.
stateStringYesBilling state or province.
countryStringYesBilling country (ISO 3166-1 alpha-2 country code, e.g., "US").
postalCodeStringYesZIP or postal code.
phoneStringYesCustomer’s phone number.
emailStringYesCustomer’s email address.
dateOfBirthStringYesCustomer’s date of birth in YYYY-MM-DD format.

Order Object

The object contains information about the order or purchase associated with the transaction. This order data can help with tracking and reporting.

FieldTypeRequiredDescription
dateStringNoDate of the order in ISO 8601 format (e.g., "2025-07-17").
orderIdStringNoUnique identifier for the order in your system.
titleStringNoTitle or description of the order (e.g., "Monthly Subscription" or product name).
siteIdStringNoIdentifier for the site or platform where the order was placed (if applicable).
nameStringNoName of the customer (if not provided elsewhere).
domainNameStringNoDomain name of the site where the order was placed (e.g., "shop.example.com").

Device Object

The device object captures information about the customer’s device and browser environment, used for
fraud prevention and 3D Secure authentication.

FieldTypeRequiredDescription
deviceIdStringNoUnique identifier for the device (if you generate one for the user).
fingerprintDataStringNoDevice fingerprint or hash for risk assessment.
ipStringYesIP address of the customer’s device.
acceptStringNoBrowser’s Accept header value. Required for 3D Secure transactions.
acceptHeaderStringNoAlternative Accept header field. Required for 3D Secure if accept is not provided.
acceptLanguageStringNoBrowser’s Accept-Language header. Required for 3D Secure.
userAgentStringNoBrowser’s User-Agent string.
javaEnabledBooleanNoWhether Java is enabled in the browser. Required for 3D Secure.
javaScriptEnabledBooleanNoWhether JavaScript is enabled in the browser. Required for 3D Secure.
deviceLanguageStringNoDevice’s language setting. Required for 3D Secure.
colorDepthStringNoScreen color depth (e.g., "24" for 24-bit). Required for 3D Secure.
screenHeightStringNoScreen height in pixels. Required for 3D Secure.
screenWidthStringNoScreen width in pixels. Required for 3D Secure.
deviceTimezoneStringNoDevice’s time zone in IANA format (e.g., "America/New_York"). Required for 3D Secure.

Example Request

{
  "requestId": "req12345",
  "mid": "merchant456",
  "card": {
    "number": "4111111111111111",
    "cardHolderName": "John Doe",
    "expMonth": "12",
    "expYear": "2028",
    "cvv": "123",
    "requestThreeDSecure": true
  },
  "amount": "100.00",
  "currency": "USD",
  "lang": "en",
  "callbackUrl": "https://yourserver.com/callback",
  "successRedirectUrl": "https://yourserver.com/success",
  "failureRedirectUrl": "https://yourserver.com/failure",
  "billingDetails": {
    "firstName": "John",
    "lastName": "Doe",
    "address1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "country": "US",
    "postalCode": "10001",
    "phone": "+123456789",
    "email": "john.doe@example.com",
    "dateOfBirth": "1990-01-01"
  },
  "order": {
    "date": "2025-07-17",
    "orderId": "ord789",
    "title": "Product Purchase",
    "siteId": "site001",
    "name": "John Doe",
    "domainName": "example.com"
  },
  "device": {
    "deviceId": "device123",
    "fingerprintData": "abcde12345",
    "ip": "192.168.1.1",
    "accept": "*/*",
    "acceptLanguage": "en-US",
    "userAgent": "Mozilla/5.0",
    "javaEnabled": true,
    "javaScriptEnabled": true,
    "deviceLanguage": "en",
    "colorDepth": "24",
    "screenHeight": "1080",
    "screenWidth": "1920",
    "deviceTimezone": "America/New_York"
  },
  "kycVerified": true,
  "previousPaymentCount": 5,
  "metadata": {
    "promoCode": "PROMO123",
    "campaign": "Winter2025"
  }
}
 
 

#Success Response

After a payment initiation request, the API will return a JSON response with the transaction reference and
status. The key fields in the response include:

FieldTypeDescription
transactionIdStringUnique identifier for the transaction. You can use this to query status or info later.
transactionStatusStringCurrent status of the transaction (e.g., NEW, PENDING, CUSTOMER_VERIFICATION, SUCCEED, FAILED, REFUNDED).
declineCodeInt(Optional) A code indicating the reason for a failure, if the transaction was declined.
challengeUrlString(Conditional) URL to redirect the customer for 3D Secure authentication (if transactionStatus requires it).
challengeUrlIframeString(Conditional) URL for an embeddable 3D Secure challenge (for iframe integration, if supported).
paymentTypeStringPayment type identifier (e.g., CARD or APM).

Example Success Response

{
"transactionId": "733609401625775730",
"transactionStatus": "CUSTOMER_VERIFICATION",
"challengeUrl": "https://secure-3ds-url.com/challenge?
id=C8W94B63DBD4STT5_17527427055183026&url=",
"challengeUrlIframe": "https://secure-3ds-url.com/iframe-challenge?
id=C8W94B63DBD4STT5_17527427055183026&url="
}

In the above example, the transaction was created and requires 3D Secure verification
(transactionStatus is "CUSTOMER_VERIFICATION"). The customer should be redirected to the
challengeUrl (or an iframe should load the challengeUrlIframe) to complete authentication.

Example Failure Response:

{
"transactionId": "txn67890",
"transactionStatus": "FAILED",
"declineCode": 101
}

If a transaction fails immediately (for example, due to invalid card details or insufficient funds), the
transactionStatus will be "FAILED" and a declineCode be provided.

Was this helpful?