Initiation of payments
POST
/api/v1/payment
Request
Header Params
Content-Type
string
required
Example:
application/json; charset=UTF-8
signature
string
required
Example:
*********
timestamp
string
required
Example:
1743487706607
timezone
string
required
Example:
Asia/Shanghai
Body Params application/json
merchant_id
string
required
env
object
required
terminal_type
string
required
The valid values are:
WAP: The client terminal type is H5 page, which can be opened through a mobile browser.
APP: The client terminal type is a mobile application.
MINI-APP: The terminal type on the merchant end is a mobile mini program.
client_ip
string
required
<= 64 characters
browser_info
object
required
device_info
object
optional
order
object
required
merchant_order_id
string
required
This field is used for displaying user consumption records and other further operations such as dispute tracking or handling customer complaints.
<= 64 characters
goods
array [object {8}]
optional
shipping
object
required
payment_amount
object
required
payment_method
object
required
metadata
object
optional
redirect_url
string
required
<= 2048 characters
Example
{
"merchant_id": "1",
"env": {
"terminal_type": "WEB",
"client_ip": "143.45.4.222",
"browser_info": {
"user_agent": "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/5.1)"
}
},
"order": {
"merchant_order_id": "99999999999",
"shipping": {
"shipping_name": {
"first_name": "KING",
"last_name": "MIsa",
"full_name": "KING MIsa"
},
"shipping_address": {
"country": "US",
"state": "TX",
"city": "Austin",
"address1": "789 Oak Ave",
"address2": "",
"zip_code": "78701"
},
"email": "example@example.com",
"phone": "+864-281-1794",
"carrier": "USPS"
},
"payment_amount": {
"currency": "USD",
"value": 1000
},
"payment_method": {
"payment_type": "CARD",
"payment_data": {
"country": "US",
"card_number": "4111111111111111",
"expiry_year": "30",
"expiry_month": "03",
"cvv": "737",
"card_holder_name": {
"first_name": "KING",
"last_name": "MIsa",
"full_name": "KING MIsa"
},
"billing_address": {
"country": "US",
"state": "TX",
"city": "Austin",
"address1": "789 Oak Ave",
"address2": "",
"zip_code": "78701"
},
"requires_3ds": false
}
},
"metadata": {
"shop": "happy",
"domain": "example.com"
}
},
"redirect_url": "https://example.com/reutrn"
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/payment' \
--header 'signature: *********' \
--header 'timestamp: 1743487706607' \
--header 'timezone: Asia/Shanghai' \
--header 'Content-Type: application/json; charset=UTF-8' \
--data-raw '{
"merchant_id": "1",
"env": {
"terminal_type": "WEB",
"client_ip": "143.45.4.222",
"browser_info": {
"user_agent": "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/5.1)"
}
},
"order": {
"merchant_order_id": "99999999999",
"shipping": {
"shipping_name": {
"first_name": "KING",
"last_name": "MIsa",
"full_name": "KING MIsa"
},
"shipping_address": {
"country": "US",
"state": "TX",
"city": "Austin",
"address1": "789 Oak Ave",
"address2": "",
"zip_code": "78701"
},
"email": "example@example.com",
"phone": "+864-281-1794",
"carrier": "USPS"
},
"payment_amount": {
"currency": "USD",
"value": 1000
},
"payment_method": {
"payment_type": "CARD",
"payment_data": {
"country": "US",
"card_number": "4111111111111111",
"expiry_year": "30",
"expiry_month": "03",
"cvv": "737",
"card_holder_name": {
"first_name": "KING",
"last_name": "MIsa",
"full_name": "KING MIsa"
},
"billing_address": {
"country": "US",
"state": "TX",
"city": "Austin",
"address1": "789 Oak Ave",
"address2": "",
"zip_code": "78701"
},
"requires_3ds": false
}
},
"metadata": {
"shop": "happy",
"domain": "example.com"
}
},
"redirect_url": "https://example.com/reutrn"
}'
Responses
🟢200成功
application/json
Body
data
object
required
amount
integer
required
currency
string
required
id
string
required
merchant_order_id
string
required
This field is used for displaying user consumption records and other further operations such as dispute tracking or handling customer complaints.
result
object
required
next_action
object
optional
Example
{
"data": {
"amount": 7506,
"currency": "USD",
"id": "pi_dyanFivWOgqbD43bZihyyl5F",
"merchant_order_id": "2d187596-2aa1-43a5-b4b3-4a339cd61491",
"result": {
"result_code": "SUCCEEDED",
"result_status": "S"
}
}
}
Modified at 2025-05-19 05:23:06