Make payments, do refunds, and customs declaration for orders.
This is the documentation for version 1.0.0
of the API. Last update on May 20, 2020.
https://nomad.samarkand-global.cn/broker
Make payments, do refunds, and customs declaration for orders.
This is the documentation for version 1.0.0
of the API. Last update on May 20, 2020.
https://nomad.samarkand-global.cn/broker
Send an authentication token in the
x-ca-key
header
to authenticate with the API.
ID used for refund
Payment method of the order - wechatpay or alipay
Order transection ID from payment
Sub order reference
Products in this sub order
In CNY. Total amount of this sub order excluding logistics fee, which uses the base unit of the currency.
In CNY. Logistics fee of this sub order, which uses the base unit of the currency.
curl \
-X POST https://nomad.samarkand-global.cn/broker/declare \
-H "Content-Type: application/json" \
-d '{"reportId":"A0987654321","paymentMethod":"wechatpay","trxId":"TX1234567890","subOrder":[{"subOrderRef":"O123456789S1","product":[{"name":"Everyday Hair Conditioner","url":"https://myshop.com/everyday-hair-conditioner"}],"totalFee":1050,"logsiticsFee":50}]}'
{
"reportId": "A0987654321",
"paymentMethod": "wechatpay",
"trxId": "TX1234567890",
"subOrder": [
{
"subOrderRef": "O123456789S1",
"product": [
{
"name": "Everyday Hair Conditioner",
"url": "https://myshop.com/everyday-hair-conditioner"
}
],
"totalFee": 1050,
"logsiticsFee": 50
}
]
}
{
"status": "SUCCESS"
}
{
"errors": "Not Authenticated."
}
{
"field": "reportId",
"msg": "cannot be empty"
}
{
"errors": "Something wrong when making the payment."
}
Declare an order after successful payment.
Initial request url to the payment provider
Response got from the initial request
Paycode of the payment provider
Payment transaction ID from payment provider
In RMB Yuan. Total amount of order.
In YYYYMMDDHHMMSS format. Payment transaction time
Order ID used in payment customs declaration. This should be in the response of payment provider.
Products of the order
Bank account number for receiving the payment
Bank account name for receiving the payment
curl \
-X POST https://nomad.samarkand-global.cn/broker/declare-order \
-H "Content-Type: application/json" \
-d '{"initialRequest":"https://pay.globepay.co/api/v1.0/wechat_jsapi_gateway/partners/F96FTB/orders/TEM1129354775085478274207817?time=1587033049529\u0026nonce_str=TEM1129354775085478274207817\u0026sign=cf78e7c81bd00717697c2b11577b48e66770504cb97d2a9b9621d1e99d8a9182","initialResponse":"{\"partner_order_id\":\"TEM1129354775085478274207817\",\"full_name\":\"Samarkand Global Limited\",\"partner_name\":\"SMK\",\"channel\":\"Wechat\",\"result_code\":\"SUCCESS\",\"partner_code\":\"F96FTB\",\"order_id\...}'
{
"initialRequest": "https://pay.globepay.co/api/v1.0/wechat_jsapi_gateway/partners/F96FTB/orders/TEM1129354775085478274207817?time=1587033049529&nonce_str=TEM1129354775085478274207817&sign=cf78e7c81bd00717697c2b11577b48e66770504cb97d2a9b9621d1e99d8a9182",
"initialResponse": "{\"partner_order_id\":\"TEM1129354775085478274207817\",\"full_name\":\"Samarkand Global Limited\",\"partner_name\":\"SMK\",\"channel\":\"Wechat\",\"result_code\":\"SUCCESS\",\"partner_code\":\"F96FTB\",\"order_id\":\"0463920200416113050166181\",\"return_code\":\"SUCCESS\",\"pay_url\":\"https://pay.globepay.co/api/v1.0/wechat_jsapi_gateway/partners/F96FTB_order_TEM1129354775085478274207817\"}",
"payCode": "4403169D3W",
"payTrxId": 681765585945696378010,
"totalAmount": 486.8,
"tradingTime": 20200501112345,
"orderNo": "0463920200416113050166181",
"product": [
{
"name": "Everyday Hair Conditioner",
"url": "https://myshop.com/everyday-hair-conditioner"
}
],
"recpAccount": 22210940,
"recpName": "Samarkand Global Limited"
}
{
"status": "SUCCESS"
}
{
"errors": "Not Authenticated."
}
{
"field": "initialRequest",
"msg": "cannot be empty"
}
{
"errors": "Something wrong when making the declaration."
}
Must be wechatpay
or alipay
Order reference
Order total amount, which uses the base unit of current currency
Must be CNY
or GBP
This url is notified when the payment succeeds
This url is redirected to once the payment completes
All products in this order
curl \
-X POST https://nomad.samarkand-global.cn/broker/pay \
-H "Content-Type: application/json" \
-d '{"paymentMethod":"wechatpay","ref":"O123456789","total":2200,"currency":"CNY","orderSuccessUrl":"https://notify.order.success","redirectUrl":"https://show.order.success.page","product":[{"name":"Everyday Hair Conditioner","url":"https://myshop.com/everyday-hair-conditioner"}]}'
{
"paymentMethod": "wechatpay",
"ref": "O123456789",
"total": 2200,
"currency": "CNY",
"orderSuccessUrl": "https://notify.order.success",
"redirectUrl": "https://show.order.success.page",
"product": [
{
"name": "Everyday Hair Conditioner",
"url": "https://myshop.com/everyday-hair-conditioner"
}
]
}
{
"payUrl": "https://payment.page.for.the.order",
"trxId": "TX1234567890"
}
{
"errors": "Not Authenticated."
}
{
"field": "ref",
"msg": "cannot be empty"
}
{
"errors": "Something wrong when making the payment."
}
curl \
-X POST https://nomad.samarkand-global.cn/broker/refund \
-H "Content-Type: application/json" \
-d '{"refundId":"R0987654321","trxId":"TX1234567890","amount":2200}'
{
"refundId": "R0987654321",
"trxId": "TX1234567890",
"amount": 2200
}
{
"status": "SUCCESS"
}
{
"errors": "Not Authenticated."
}
{
"field": "refundId",
"msg": "cannot be empty"
}
{
"errors": "Something wrong when making the payment."
}