メインコンテンツへスキップ
POST
/
v1
/
payments
決済作成
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認証

Body

application/json
amount
integer
required

決済金額(正の整数)

Example:

1000

currency
string
required

3文字の通貨コード(例: usd, sgd, jpy)

Example:

"usd"

capture_method
enum<string>
default:automatic

キャプチャ方式

利用可能なオプション:
automatic,
manual
return_url
string

3Dセキュア認証後のリダイレクトURL(payment_method.tokenを使用する場合のみ指定可能。ホスト型チェックアウトでは不要)

Example:

"https://example.com/complete"

external_id
string

加盟店側の注文ID

Example:

"order_12345"

flow_id
string

使用するフローID(省略時はデフォルトフロー)

Example:

"flow_abc123"

payment_method

決済方法(文字列またはオブジェクト形式)

Example:

"card"

metadata
object

トランザクションに保存する追加データ

Response

決済作成成功

success
boolean

処理成功フラグ

Example:

true

status
string

ステータス

Example:

"pending"

transaction_id
string

トランザクションID

Example:

"tx_abc123"

gateway_transaction_id
string

PSP側のトランザクションID

Example:

"pi_xxxxx"

client_secret
string

フロントエンドで決済確定に使用するシークレット(カード決済時)

Example:

"pi_xxx_secret_yyy"

payment_url
string

決済ページのURL(リダイレクト型決済時)

Example:

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