Skip to main content
POST
/
v1
/
payments
Create Payment
curl --request POST \
  --url https://api.sandbox.zafapay.com/v1/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 1000,
  "currency": "usd",
  "capture_method": "automatic",
  "return_url": "https://example.com/complete",
  "external_id": "order_12345",
  "flow_id": "flow_abc123",
  "payment_method": "card",
  "metadata": {}
}
'
{
  "success": true,
  "status": "pending",
  "transaction_id": "tx_abc123",
  "gateway_transaction_id": "pi_xxxxx",
  "client_secret": "pi_xxx_secret_yyy",
  "payment_url": "https://pay.sandbox.zafapay.com/checkout/tx_abc123?sig=xxxxxxxxxxxxxxxx"
}

Authorizations

Authorization
string
header
required

Bearer authentication using access token

Body

application/json
amount
integer
required

Payment amount (positive integer)

Example:

1000

currency
string
required

3-letter currency code (e.g., usd, sgd, jpy)

Example:

"usd"

capture_method
enum<string>
default:automatic

Capture method

Available options:
automatic,
manual
return_url
string

Redirect URL after 3D Secure authentication (only available when using payment_method.token; not required for hosted checkout)

Example:

"https://example.com/complete"

external_id
string

Merchant's order ID

Example:

"order_12345"

flow_id
string

Flow ID to use (defaults to default flow if omitted)

Example:

"flow_abc123"

payment_method

Payment method (string or object format)

Example:

"card"

metadata
object

Additional data to store with the transaction

Response

Payment created successfully

success
boolean

Processing success flag

Example:

true

status
string

Status

Example:

"pending"

transaction_id
string

Transaction ID

Example:

"tx_abc123"

gateway_transaction_id
string

PSP transaction ID

Example:

"pi_xxxxx"

client_secret
string

Secret for frontend payment confirmation (for card payments)

Example:

"pi_xxx_secret_yyy"

payment_url
string

Payment page URL (for redirect-type payments)

Example:

"https://pay.sandbox.zafapay.com/checkout/tx_abc123?sig=xxxxxxxxxxxxxxxx"