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": 17.62,
  "currency": "usd",
  "capture_method": "automatic",
  "external_id": "order_12345",
  "flow_id": "flow_abc123",
  "payment_method": "card",
  "metadata": {},
  "save_card": true,
  "payment_method_id": "pmi_abc123",
  "name": "John Doe",
  "customer_id": "cust_abc123",
  "email": "customer@example.com",
  "tel": "+81-90-1234-5678"
}
'
{
  "id": "req_abc123",
  "status": "pending",
  "amount": 17.62,
  "currency": "usd",
  "external_id": "order_12345",
  "metadata": {},
  "flow_id": "flow_default",
  "payment_type": "single",
  "payment_url": "https://pay.sandbox.zafapay.com/checkout/req_abc123?token=xxxxxxxx",
  "created_at": "2025-01-01T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication using access token

Body

application/json
amount
number
required

Payment amount (positive number, supports up to 2 decimal places)

Example:

17.62

currency
string
required

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

Example:

"usd"

capture_method
enum<string>

Capture method (uses flow configuration if omitted)

Available options:
automatic,
manual
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

save_card
boolean

If true, save card for future recurring payments

Example:

true

payment_method_id
string

Use a saved payment method for recurring payment (get from /v1/customers/{id}/payment-methods)

Example:

"pmi_abc123"

name
string

Cardholder name (required for some payment methods)

Example:

"John Doe"

customer_id
string

Customer ID (used for saving and retrieving payment methods)

Example:

"cust_abc123"

email
string

Customer email address

Example:

"customer@example.com"

tel
string

Customer phone number

Example:

"+81-90-1234-5678"

Response

Payment created successfully

id
string

Payment request ID

Example:

"req_abc123"

status
string

Status

Example:

"pending"

amount
number

Payment amount

Example:

17.62

currency
string

Currency code

Example:

"usd"

external_id
string | null

Merchant's order ID

Example:

"order_12345"

metadata
object

Additional data (empty object if not specified)

Example:
{}
flow_id
string

Payment flow ID used

Example:

"flow_default"

payment_type
enum<string>

Payment type. single: Regular one-time payment, initial: Initial payment with card saving, recurring: Recurring payment using saved card

Available options:
single,
initial,
recurring
Example:

"single"

payment_url
string

Hosted checkout page URL (with signature)

Example:

"https://pay.sandbox.zafapay.com/checkout/req_abc123?token=xxxxxxxx"

created_at
string<date-time>

Creation timestamp (ISO 8601 format)

Example:

"2025-01-01T00:00:00.000Z"