Card Payments API

Process credit and debit card payments using server-to-server integration.

Server-to-Server Card Payment (Production)

POST/api/v1/production/card
Requires API Key

Processes a card payment directly without redirecting the user. This endpoint is suitable for server-side integrations where you handle card data securely.

Request Body

{
  "orderId": "ORD-12345",
  "amount": 100,
  "currency": "USD",
  "cardNumber": "4111111111111111",
  "cardExpiryMonth": 12,
  "cardExpiryYear": 2025,
  "cvv": "123",
  "cardholderName": "John Doe",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com",
  "address": "12, Hill",
  "city": "Nevada",
  "state": "Nevada",
  "country": "US",
  "zip": "12345",
  "webhookUrl": "https://your-domain.com/webhook",
  "returnUrl": "https://your-domain.com/payment/callback"
}

Request Parameters

ParameterTypeRequiredDescription
orderIdstringYesUnique order identifier from your system
amountnumberYesPayment amount (minimum 0.01)
currencystringYesCurrency code (3 letters, e.g., USD, EUR)
merchantProfileIdnumberNoMerchant Profile ID. Defaults to user's PRIMARY profile if not provided
cardNumberstringYesCard number (13-19 digits)
cardExpiryMonthnumberYesExpiry month (1-12)
cardExpiryYearnumberYesExpiry year (4 digits)
cvvstringNoCVV code (3-4 digits)
cardholderNamestringNoCardholder name
firstNamestringNoCustomer first name
lastNamestringNoCustomer last name
emailstringNoCustomer email address
addressstringYesCustomer billing street address
citystringYesCustomer billing city
statestringYesCustomer billing state / region
countrystringYesCustomer billing country (2-letter ISO code)
zipstringYesCustomer billing ZIP / postal code
webhookUrlstringNoWebhook URL for transaction notifications
returnUrlstringNoURL to redirect the customer after payment (optional)

Success Response

200
{
  "success": true,
  "status": "SUCCESS",
  "data": {
    "amount": 100,
    "currency": "USD",
    "order_id": "ORD-12345",
    "txn_id": "FP260231SJWKL80027",
    "firstName": "John",
    "lastName": "Doe",
    "address": "12, Hill",
    "city": "Nevada",
    "state": "Nevada",
    "country": "US",
    "email": "john@example.com",
    "webhookUrl": "https://your-domain.com/webhook"
  }
}

Error Response

400
{
  "success": false,
  "error": {
    "code": "INVALID_CARD",
    "message": "The card number is invalid"
  }
}
Important: This endpoint requires a merchant acquirer account to be assigned to your merchant profile. If no assignment exists, the transaction will fail immediately with a clear error message.

Server-to-Server Card Payment (Sandbox)

POST/api/v1/sandbox/card
Requires API Key

Uses test gateway for sandbox testing. All transactions are simulated and do not process real payments.

Request Body

Same request body as production endpoint. Use test card numbers for testing:

{
  "orderId": "ORD-12345",
  "amount": 100,
  "currency": "USD",
  "cardNumber": "4111111111111111",
  "cardExpiryMonth": 12,
  "cardExpiryYear": 2025,
  "cvv": "123",
  "cardholderName": "John Doe",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com",
  "address": "12, Hill",
  "city": "Nevada",
  "state": "Nevada",
  "country": "US",
  "zip": "12345",
  "webhookUrl": "https://your-domain.com/webhook",
  "returnUrl": "https://your-domain.com/payment/callback"
}

Test Card Numbers

Card NumberResult
4111111111111111Success
4111111111111112Declined

Transaction Flow

Card payment transactions follow this execution order:

  1. Merchant ownership validation (via API key)
  2. merchantProfileId validation (defaults to PRIMARY if not provided)
  3. merchant_acquirer_account validation (MANDATORY - fails if not assigned)
  4. IP whitelist check
  5. Risk management checks
  6. Card risk checks
  7. Routing & cascading logic (if configured)
  8. Acquirer API call
Critical: All transactions MUST execute through an assigned merchant_acquirer_account. If no assignment exists, the transaction will fail immediately with a clear error message.

Security & Risk Management

For card payments, the following security checks are performed:

  • IP Whitelist: Validates that the request IP is whitelisted (if IP whitelist is enabled)
  • Risk Rules: Checks for blocked cards, emails, IPs, domains, and BINs
  • Card Whitelist: Validates that the card is in trusted cards list (if card whitelist is enabled)
If any risk check fails, the transaction is immediately blocked with status BLOCKED and a webhook is triggered.