Skip to content

API 參考

/api/v1/merchant 之下的端點。每個 operation 包含 request schema、response schema,以及可直接複製貼上的四種語言程式碼範例(curl、Python、PHP、Node.js)。

「Try it」測試請求會送往 沙盒(PRE) 環境 — 簽章方式請見 認證與簽章

v0.1.0

Payment Gateway — Merchant API

Payment Gateway Platform API

服务器

https://api.open-pay.coProduction
https://pre-api.open-pay.coSandbox (PRE)

Create Deposit Order

POST
/api/v1/merchant/orders/deposit

Create a deposit order (direct type).

Returns payment information for the payer. For channel orders, payment_url
will be populated. For account orders, bank details will be populated.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

请求体

application/json
JSON
{
  
"merchant_order_no": "string",
  
"amount": 0,
  
"currency_code": "string",
  
"callback_url": "string",
  
"extra_data": "string",
  
"user_id": "string",
  
"account_holder": "string",
  
"mobile": "string",
  
"email": "string",
  
"bank_code": "string",
  
"account_no": "string"
}

响应

Successful Response

application/json
JSON
{
  
"order_no": "string",
  
"requested_amount": "string",
  
"amount": "string",
  
"currency_code": "string",
  
"bank_code": "string",
  
"bank_name": "string",
  
"bank_branch": "string",
  
"account_no": "string",
  
"account_holder": "string",
  
"remark": "string",
  
"expire_at": "string",
  
"payment_url": "string",
  
"payment_info": {
  
  
"additionalProperties": "string"
  
}
}

试验场

请求头
主体

示例


Create Cashier Deposit Order

POST
/api/v1/merchant/orders/deposit/cashier

Create a cashier deposit order.

This creates a cashier session for the hosted cashier page.
When request amount is provided, a DepositOrder is created immediately and
the cashier page skips denomination selection. When amount is omitted, the
DepositOrder is created after the user selects a denomination on the
cashier page.

Returns cashier URL and token for redirect.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

请求体

application/json
JSON
{
  
"order_type": "cashier",
  
"merchant_order_no": "string",
  
"amount": 0,
  
"currency_code": "string",
  
"callback_url": "string",
  
"extra_data": "string",
  
"user_id": "string",
  
"payer_bank_cards": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
]
}

响应

Successful Response

application/json
JSON
{
  
"cashier_url": "string",
  
"cashier_token": "string",
  
"session_id": "string",
  
"expire_at": "string"
}

试验场

请求头
主体

示例


Create Withdrawal Order

POST
/api/v1/merchant/orders/withdrawal

Create a withdrawal order.

The order may be auto-approved based on configuration.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

请求体

application/json
JSON
{
  
"merchant_order_no": "string",
  
"amount": 0,
  
"currency_code": "string",
  
"beneficiary_name": "string",
  
"beneficiary_account": "string",
  
"beneficiary_bank_code": "string",
  
"beneficiary_bank_branch": "string",
  
"callback_url": "string",
  
"extra_data": "string"
}

响应

Successful Response

application/json
JSON
{
  
"id": "string",
  
"order_no": "string",
  
"merchant_order_no": "string",
  
"merchant_id": "string",
  
"account_id": "string",
  
"amount": "string",
  
"fee": "string",
  
"actual_amount": "string",
  
"currency_code": "string",
  
"beneficiary_name": "string",
  
"beneficiary_account": "string",
  
"beneficiary_bank_code": "string",
  
"beneficiary_bank_name": "string",
  
"beneficiary_bank_branch": "string",
  
"payout_method": "string",
  
"status": "string",
  
"is_auto_approved": true,
  
"approved_at": "string",
  
"approved_by": "string",
  
"approval_remarks": "string",
  
"processed_at": "string",
  
"completed_at": "string",
  
"bank_reference": "string",
  
"callback_url": "string",
  
"callback_status": "string",
  
"callback_count": 0,
  
"created_at": "string",
  
"updated_at": "string",
  
"needs_manual_intervention": false,
  
"manual_reason": "string",
  
"channel_id": "string",
  
"channel_name": "string",
  
"channel_order_no": "string",
  
"estimated_channel_cost": "string",
  
"estimated_profit": "string",
  
"actual_channel_cost": "string",
  
"actual_profit": "string",
  
"merchant": {
  
  
"id": "string",
  
  
"merchant_code": "string",
  
  
"name": "string"
  
},
  
"approver": {
  
  
"id": "string",
  
  
"name": "string"
  
}
}

试验场

请求头
主体

示例


Query Deposit Order

GET
/api/v1/merchant/query/deposit/{order_no}

Query deposit order by order number.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

路径参数

order_no*
类型
string
必填

响应

Successful Response

application/json
JSON
{
  
"id": "string",
  
"order_no": "string",
  
"merchant_order_no": "string",
  
"merchant_id": "string",
  
"account_id": "string",
  
"requested_amount": "string",
  
"amount": "string",
  
"fee": "string",
  
"currency_code": "string",
  
"expected_remark": "string",
  
"status": "string",
  
"expire_at": "string",
  
"matched_at": "string",
  
"completed_at": "string",
  
"actual_amount": "string",
  
"callback_url": "string",
  
"callback_status": "string",
  
"callback_count": 0,
  
"created_at": "string",
  
"updated_at": "string",
  
"user_id": "string",
  
"order_type": "direct",
  
"cashier_session_id": "string",
  
"payer_bank_code": "string",
  
"payer_account_last4": "string",
  
"channel_id": "string",
  
"channel_order_no": "string",
  
"payment_url": "string",
  
"estimated_channel_cost": "string",
  
"estimated_profit": "string",
  
"actual_channel_cost": "string",
  
"actual_profit": "string",
  
"payment_snapshot": {
  
  
"additionalProperties": "string"
  
},
  
"merchant": {
  
  
"id": "string",
  
  
"merchant_code": "string",
  
  
"name": "string"
  
},
  
"account": {
  
  
"id": "string",
  
  
"account_no": "string",
  
  
"name": "string",
  
  
"bank_code": "string",
  
  
"bank_name": "string",
  
  
"account_holder": "string"
  
},
  
"channel": {
  
  
"id": "string",
  
  
"channel_code": "string",
  
  
"channel_name": "string"
  
}
}

试验场

请求头
变量

示例


Query Deposit By Merchant Order

GET
/api/v1/merchant/query/deposit

Query deposit order by merchant order number.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

查询参数

merchant_order_no*
类型
string
必填

响应

Successful Response

application/json
JSON
{
  
"id": "string",
  
"order_no": "string",
  
"merchant_order_no": "string",
  
"merchant_id": "string",
  
"account_id": "string",
  
"requested_amount": "string",
  
"amount": "string",
  
"fee": "string",
  
"currency_code": "string",
  
"expected_remark": "string",
  
"status": "string",
  
"expire_at": "string",
  
"matched_at": "string",
  
"completed_at": "string",
  
"actual_amount": "string",
  
"callback_url": "string",
  
"callback_status": "string",
  
"callback_count": 0,
  
"created_at": "string",
  
"updated_at": "string",
  
"user_id": "string",
  
"order_type": "direct",
  
"cashier_session_id": "string",
  
"payer_bank_code": "string",
  
"payer_account_last4": "string",
  
"channel_id": "string",
  
"channel_order_no": "string",
  
"payment_url": "string",
  
"estimated_channel_cost": "string",
  
"estimated_profit": "string",
  
"actual_channel_cost": "string",
  
"actual_profit": "string",
  
"payment_snapshot": {
  
  
"additionalProperties": "string"
  
},
  
"merchant": {
  
  
"id": "string",
  
  
"merchant_code": "string",
  
  
"name": "string"
  
},
  
"account": {
  
  
"id": "string",
  
  
"account_no": "string",
  
  
"name": "string",
  
  
"bank_code": "string",
  
  
"bank_name": "string",
  
  
"account_holder": "string"
  
},
  
"channel": {
  
  
"id": "string",
  
  
"channel_code": "string",
  
  
"channel_name": "string"
  
}
}

试验场

请求头
变量

示例


Query Withdrawal Order

GET
/api/v1/merchant/query/withdrawal/{order_no}

Query withdrawal order by order number.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

路径参数

order_no*
类型
string
必填

响应

Successful Response

application/json
JSON
{
  
"id": "string",
  
"order_no": "string",
  
"merchant_order_no": "string",
  
"merchant_id": "string",
  
"account_id": "string",
  
"amount": "string",
  
"fee": "string",
  
"actual_amount": "string",
  
"currency_code": "string",
  
"beneficiary_name": "string",
  
"beneficiary_account": "string",
  
"beneficiary_bank_code": "string",
  
"beneficiary_bank_name": "string",
  
"beneficiary_bank_branch": "string",
  
"payout_method": "string",
  
"status": "string",
  
"is_auto_approved": true,
  
"approved_at": "string",
  
"approved_by": "string",
  
"approval_remarks": "string",
  
"processed_at": "string",
  
"completed_at": "string",
  
"bank_reference": "string",
  
"callback_url": "string",
  
"callback_status": "string",
  
"callback_count": 0,
  
"created_at": "string",
  
"updated_at": "string",
  
"needs_manual_intervention": false,
  
"manual_reason": "string",
  
"channel_id": "string",
  
"channel_name": "string",
  
"channel_order_no": "string",
  
"estimated_channel_cost": "string",
  
"estimated_profit": "string",
  
"actual_channel_cost": "string",
  
"actual_profit": "string",
  
"merchant": {
  
  
"id": "string",
  
  
"merchant_code": "string",
  
  
"name": "string"
  
},
  
"approver": {
  
  
"id": "string",
  
  
"name": "string"
  
}
}

试验场

请求头
变量

示例


Query Withdrawal By Merchant Order

GET
/api/v1/merchant/query/withdrawal

Query withdrawal order by merchant order number.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

查询参数

merchant_order_no*
类型
string
必填

响应

Successful Response

application/json
JSON
{
  
"id": "string",
  
"order_no": "string",
  
"merchant_order_no": "string",
  
"merchant_id": "string",
  
"account_id": "string",
  
"amount": "string",
  
"fee": "string",
  
"actual_amount": "string",
  
"currency_code": "string",
  
"beneficiary_name": "string",
  
"beneficiary_account": "string",
  
"beneficiary_bank_code": "string",
  
"beneficiary_bank_name": "string",
  
"beneficiary_bank_branch": "string",
  
"payout_method": "string",
  
"status": "string",
  
"is_auto_approved": true,
  
"approved_at": "string",
  
"approved_by": "string",
  
"approval_remarks": "string",
  
"processed_at": "string",
  
"completed_at": "string",
  
"bank_reference": "string",
  
"callback_url": "string",
  
"callback_status": "string",
  
"callback_count": 0,
  
"created_at": "string",
  
"updated_at": "string",
  
"needs_manual_intervention": false,
  
"manual_reason": "string",
  
"channel_id": "string",
  
"channel_name": "string",
  
"channel_order_no": "string",
  
"estimated_channel_cost": "string",
  
"estimated_profit": "string",
  
"actual_channel_cost": "string",
  
"actual_profit": "string",
  
"merchant": {
  
  
"id": "string",
  
  
"merchant_code": "string",
  
  
"name": "string"
  
},
  
"approver": {
  
  
"id": "string",
  
  
"name": "string"
  
}
}

试验场

请求头
变量

示例


商戶餘額


Get Merchant Balances

GET
/api/v1/merchant/balance

Get all balances for the authenticated merchant.

参数

请求头参数

x-api-key*
类型
string
必填
x-timestamp*
类型
string
必填
x-signature*
类型
string
必填

响应

Successful Response

application/json
JSON
{
  
"items": [
  
  
{
  
  
  
"id": "string",
  
  
  
"merchant_id": "string",
  
  
  
"currency_code": "string",
  
  
  
"available_balance": "string",
  
  
  
"frozen_balance": "string",
  
  
  
"total_balance": "string",
  
  
  
"version": 0,
  
  
  
"created_at": "string",
  
  
  
"updated_at": "string"
  
  
}
  
],
  
"merchant_id": "string"
}

试验场

请求头

示例


技术支持 VitePress OpenAPI