Nomad Broker
1.8.0
Nomad payment provider aggregation, including make payments, and customs declaration for orders and etc.
This is the documentation for version 1.8.0
of the API. Last update on Aug 1, 2022.
https://nomad.samarkand-global.cn/broker/v1
payment
Transaction services.
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. weixinpay.test
Query parameters
-
order_ref string Required
Merchant order no.
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X GET https://nomad.samarkand-global.cn/broker/v1/payment/wechat.sh_smk?order_ref=test202101 \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"orderRef": "test202103",
"payerCurrency": "CNY",
"currency": "CNY",
"payerTotal": 10,
"actualAmount": 2200,
"total": 10,
"bankType": "string",
"Timing": "2021-11-02T17:03:38+08:00",
"transactionId": "4200001148202111020556019250",
"tradeState": "SUCCESS",
"tradeStateDesc": "支付成功",
"tradeType": "MWEB",
"tradeMessage": "string"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. weixinpay.test
Body
-
paymentMethod string Required
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
. -
paymentType string Required
Payment companies have different payment types
Values are
NATIVE
,H5
,JSAPI
,MINIPRO
, orAPP
. -
orderRef string Required
Merchant system order number
-
actualAmount integer Required
Order actual amount, which uses the base unit of current currency
-
total integer
Order total amount, which uses the base unit of current currency
-
subsidyAmount integer
Subsidy amount, only works when profitSharing is True
-
costPrice integer
When the original order price is not equal to the payment amount, the discount will not be enjoyed. This field is mainly used to prevent the same invoice from being paid multiple times to enjoy multiple discounts.
-
invoiceId string
Merchant invoice ID, need to use with products data
-
currency string Required
Must be
CNY
orGBP
-
profitSharing boolean
Whether the order is going to share profit
Default value is
true
. -
products array[object] | null
Payment product
-
description string
Order product description
-
attach string
Payment attach data, which could be used by payment notifies
-
timeExpire string
Payment due time
-
goodsTag string
Coupon goods tag
-
payerId string
Payer ID of customer in service provider side.
-
merchantPayerId string
Payer ID of customer in merchant side.
-
notifyUrl string
Notify url, that is used by payment company.
-
successUrl string
Success url, that is used by alipay company.
-
cancelUrl string
Cancel url, that is used by alipay company.
-
spAppId string
App ID of payment company.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/payment/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-H "X-Real-Ip: string" \
-H "Client-Id: string" \
-d '{"paymentMethod":"wechatpay","paymentType":"H5","orderRef":"O123456789","actualAmount":2200,"total":2200,"subsidyAmount":0,"costPrice":0,"invoiceId":"string","currency":"CNY","profitSharing":true,"products":[{"goodsName":"Orange","goodsCategory":"health-beauty/fragrance","goodsUnitPrice":12,"goodsQuantity":1,"merchantProductId":"barcode123456","paymentProductId":1246464644}],"description":"面膜 mask","attach":"Payment attach mark","timeExpire":"2022-02-24T14:02:38Z","goodsTag":"new","payerId":"osGEYs0HfdUF4R965HMmEPKqOSWw","merchantPayerId":"osGEYs0HfdUF4R965HMmEPKqOSWw","notifyUrl":"https://www.weixin.qq.com/wxpay/pay.php","successUrl":"https://www.weixin.qq.com/wxpay/pay.php","cancelUrl":"https://www.weixin.qq.com/wxpay/pay.php","spAppId":"string"}'
# Headers
X-Real-Ip: string
Client-Id: string
# Payload
{
"paymentMethod": "wechatpay",
"paymentType": "H5",
"orderRef": "O123456789",
"actualAmount": 2200,
"total": 2200,
"subsidyAmount": 0,
"costPrice": 0,
"invoiceId": "string",
"currency": "CNY",
"profitSharing": true,
"products": [
{
"goodsName": "Orange",
"goodsCategory": "health-beauty/fragrance",
"goodsUnitPrice": 12,
"goodsQuantity": 1,
"merchantProductId": "barcode123456",
"paymentProductId": 1246464644
}
],
"description": "面膜 mask",
"attach": "Payment attach mark",
"timeExpire": "2022-02-24T14:02:38Z",
"goodsTag": "new",
"payerId": "osGEYs0HfdUF4R965HMmEPKqOSWw",
"merchantPayerId": "osGEYs0HfdUF4R965HMmEPKqOSWw",
"notifyUrl": "https://www.weixin.qq.com/wxpay/pay.php",
"successUrl": "https://www.weixin.qq.com/wxpay/pay.php",
"cancelUrl": "https://www.weixin.qq.com/wxpay/pay.php",
"spAppId": "string"
}
{
"code": 200,
"message": "success",
"payMessage": "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx031",
"payInvokeMessage": "weixin://wap/pay?prepayid%3Dwx03143347..",
"timeStamp": 1414561699,
"nonceStr": "5K8264ILTKCH16CQ2502SI8ZNMTM67VS"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Query parameters
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/payment/close/wechat.sh_smk/orderno2022030300011 \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"paymentMessage": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. weixinpay.test
Body
-
paymentMethod string Required
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
. -
paymentType string Required
Payment companies have different payment types
Values are
NATIVE
,H5
,JSAPI
,MINIPRO
, orAPP
. -
payMessage string Required
Pay message responsed from payment company
-
timeStamp string
This url is notified when the payment succeeds
-
nonceStr string
A random string of up to 32 characters
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/payment/invocation/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"paymentMethod":"wechatpay","paymentType":"H5","payMessage":"https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx2711083","timeStamp":1414561699,"nonceStr":"5K8264ILTKCH16CQ2502SI8ZNMTM67VS"}'
{
"paymentMethod": "wechatpay",
"paymentType": "H5",
"payMessage": "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx2711083",
"timeStamp": 1414561699,
"nonceStr": "5K8264ILTKCH16CQ2502SI8ZNMTM67VS"
}
{
"code": 200,
"message": "success",
"payMessage": "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx031",
"payInvokeMessage": "weixin://wap/pay?prepayid%3Dwx03143347..",
"timeStamp": 1414561699,
"nonceStr": "5K8264ILTKCH16CQ2502SI8ZNMTM67VS"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
customs
The payment customs declarance.
GetCustomsPayment
Merchant queries customs clearance information by order number
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Query parameters
-
customs string Required
Customs code, available options: GUANGZHOU_ZS, HANGZHOU_ZS, NINGBO, ZHENGZHOU_BS, CHONGQING, SHANGHAI_ZS, SHENZHEN, ZHENGZHOU_ZH_ZS
Values are
GUANGZHOU_ZS
,HANGZHOU_ZS
,NINGBO
,ZHENGZHOU_BS
,CHONGQING
,SHANGHAI_ZS
,SHENZHEN
,ZHENGZHOU_ZH_ZS
, orTIANJIN
. Default value isGUANGZHOU_ZS
. -
order_no string
The internal order number of the merchant system
-
transaction_id string
Payment system internal order number
-
sub_order_no string
The internal sub-order number of the merchant system
-
sub_order_id string
The internal sub-order number of the payment company system
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X GET https://nomad.samarkand-global.cn/broker/v1/customs/payment/wechat.sh_smk?customs=GUANGZHOU_ZS \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"customsMessage": "<xml><return_code><![CDATA[SUCCESS]]></return_code>...</xml>",
"resultCode": "success",
"transactionId": "1000320306201511078440737890",
"orders": [
{
"state": "UNDECLARED",
"subOrderNo": "1000320306201511078440737890",
"subOrderId": "4200001306202110500000000000.0",
"mchCustomsNo": "31123452K0",
"explanation": "string",
"customs": "string",
"modifyTime": "20091227091010",
"duty": 88,
"feeType": "CNY",
"orderFee": 88,
"transportFee": 88,
"productFee": 88,
"certType": "IDCARD",
"certCheckResult": "UNCHECKED",
"verifyDepartment": "OTHERS",
"verifyDepartmentTradeId": "OTHERS"
}
]
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
customs string Required
Customs codes
Values are
GUANGZHOU_ZS
,HANGZHOU_ZS
,NINGBO
,ZHENGZHOU_BS
,CHONGQING
,SHANGHAI_ZS
,SHENZHEN
,ZHENGZHOU_ZH_ZS
, orTIANJIN
. Default value isGUANGZHOU_ZS
. -
mchCustomsNo string Required
The merchant’s record number registered in the customs
-
orderNo string
The internal order number of the merchant system, only numbers, uppercase and lowercase letters, and it is unique under the same merchant number.
-
transactionId string
Transaction ID returned by payment company
-
subOrderNo string
Merchant's sub-order number, must be passed if there is a split order
-
subOrderId string
Do not fill in the sub-order number. Order number returned by payment company
-
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
.
curl \
-X PUT https://nomad.samarkand-global.cn/broker/v1/customs/payment/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"customs":"GUANGZHOU_ZS","mchCustomsNo":"31123452K0","orderNo":"test2021101901","transactionId":"4200001306202110500000000000.0","subOrderNo":"1000320306201511078440737890","subOrderId":"4200001306202110500000000000.0","paymentMethod":"wechatpay"}'
{
"customs": "GUANGZHOU_ZS",
"mchCustomsNo": "31123452K0",
"orderNo": "test2021101901",
"transactionId": "4200001306202110500000000000.0",
"subOrderNo": "1000320306201511078440737890",
"subOrderId": "4200001306202110500000000000.0",
"paymentMethod": "wechatpay"
}
{
"code": 200,
"message": "success",
"customsMessage": "<xml><return_code><![CDATA[SUCCESS]]></return_code>...</xml>",
"resultCode": "success",
"state": "UNDECLARED",
"transactionId": "1000320306201511078440737890",
"orderNo": "1000320306201511078440737890",
"subOrderNo": "1000320306201511078440737890",
"modifyTime": "20091227091010",
"certCheckResult": "UNCHECKED",
"verifyDepartment": "OTHERS",
"verifyDepartmentTradeId": "OTHERS"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
orderNo string Required
The internal order number of the merchant system, only numbers, uppercase and lowercase letters, and it is unique under the same merchant number.
-
transactionId string Required
Transaction ID returned by Payment company
-
customs string Required
Customs codes
Values are
GUANGZHOU_ZS
,HANGZHOU_ZS
,NINGBO
,ZHENGZHOU_BS
,CHONGQING
,SHANGHAI_ZS
,SHENZHEN
,ZHENGZHOU_ZH_ZS
, orTIANJIN
. Default value isGUANGZHOU_ZS
. -
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
. -
mchCustomsNo string
The merchant’s record number registered in the customs
-
certType string
Only mainland ID cards are supported temporarily.
Default value is
IDCARD
. -
certId string
The user's mainland ID number, the ID number ending in the letter X, please capitalize the letter X.
-
name string
User name.
-
duty integer
Tariff, divided into units
-
actionType string
ADD New customs declaration application, MODIFY modification. Default is ADD
Values are
ADD
orMODIFY
. Default value isADD
. -
subOrderNo string
Merchant's sub-order number, must be passed if there is a split order
-
feeType string
The currency used for payment of Payment company orders is currently only supported in RMB CNY. If there is an order split, it must be sent.
Default value is
CNY
. -
orderFee integer
The amount of the sub-order, in cents, cannot exceed the amount of the original order, order_fee=transport_fee+product_fee (amount payable = logistics fee + product price), if there is a split order, it must be passed.
-
transportFee integer
The logistics cost is divided into units, and must be passed if there is a split order.
-
productFee integer
Commodity costs, in units of cents, must be passed if there is a split order.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/customs/payment/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"orderNo":"test2021101901","transactionId":"4200001306202110500000000000.0","customs":"GUANGZHOU_ZS","paymentMethod":"wechatpay","mchCustomsNo":"31123452K0","certType":"IDCARD","certId":330821198809085200,"name":"Zhangsan","duty":88,"actionType":"ADD","subOrderNo":20150806125346,"feeType":"CNY","orderFee":88,"transportFee":88,"productFee":88}'
{
"orderNo": "test2021101901",
"transactionId": "4200001306202110500000000000.0",
"customs": "GUANGZHOU_ZS",
"paymentMethod": "wechatpay",
"mchCustomsNo": "31123452K0",
"certType": "IDCARD",
"certId": 330821198809085200,
"name": "Zhangsan",
"duty": 88,
"actionType": "ADD",
"subOrderNo": 20150806125346,
"feeType": "CNY",
"orderFee": 88,
"transportFee": 88,
"productFee": 88
}
{
"code": 200,
"message": "success",
"customsMessage": "<xml><return_code><![CDATA[SUCCESS]]></return_code>...</xml>",
"resultCode": "success",
"state": "UNDECLARED",
"transactionId": "1000320306201511078440737890",
"orderNo": "1000320306201511078440737890",
"subOrderNo": "1000320306201511078440737890",
"modifyTime": "20091227091010",
"certCheckResult": "UNCHECKED",
"verifyDepartment": "OTHERS",
"verifyDepartmentTradeId": "OTHERS"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
PostCustomsIdentification
Upload the payer identity information which will be re-verified by payment provider, supported payment method: wechatpay
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
orderNo string Required
The internal order number of the merchant system, only numbers, uppercase and lowercase letters, and it is unique under the same merchant number.
-
transactionId string Required
Transaction ID returned by Payment company
-
subOrderNo string
Merchant's sub-order number, must be passed if there is a split order
-
customs string Required
Customs codes
Values are
GUANGZHOU_ZS
,HANGZHOU_ZS
,NINGBO
,ZHENGZHOU_BS
,CHONGQING
,SHANGHAI_ZS
,SHENZHEN
,ZHENGZHOU_ZH_ZS
, orTIANJIN
. Default value isGUANGZHOU_ZS
. -
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
. -
mchCustomsNo string
The merchant’s record number registered in the customs
-
certType string Required
Only mainland ID cards are supported temporarily.
Default value is
IDCARD
. -
certId string Required
The user's mainland ID number, the ID number ending in the letter X, please capitalize the letter X.
-
certName string Required
Payer name.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/customs/identification/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"orderNo":"test2021101901","transactionId":"4200001306202110500000000000.0","subOrderNo":20150806125346,"customs":"GUANGZHOU_ZS","paymentMethod":"wechatpay","mchCustomsNo":"31123452K0","certType":"IDCARD","certId":330821198809085200,"certName":"Zhangsan"}'
{
"orderNo": "test2021101901",
"transactionId": "4200001306202110500000000000.0",
"subOrderNo": 20150806125346,
"customs": "GUANGZHOU_ZS",
"paymentMethod": "wechatpay",
"mchCustomsNo": "31123452K0",
"certType": "IDCARD",
"certId": 330821198809085200,
"certName": "Zhangsan"
}
{
"code": 200,
"message": "success",
"orderNo": "test2021101901",
"transactionId": "4200001306202110500000000000.0",
"subOrderNo": 20150806125346,
"customs": "string",
"mchCustomsNo": "31123452K0",
"certType": "IDCARD",
"certId": 330821198809085200,
"certName": "Zhangsan"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
refund
The refund services.
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. weixinpay.test
Query parameters
-
order_ref string
Merchant payment order no.
-
refund_order_ref string Required
Merchant payment refund no.
-
refund_id string
Payment company refund no.
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X GET https://nomad.samarkand-global.cn/broker/v1/refund/wechat.sh_smk?refund_order_ref=r001test20220125001 \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"refundId": "refund_id_payment_company",
"orderRef": "test20220125001",
"refundOrderRef": "r001test20220125001",
"transactionId": "4200001148202111020556019250",
"channel": "ORIGINAL",
"userReceivedAccount": "0403**",
"createTime": "2021-11-02T17:03:38+08:00",
"successTime": "2021-11-02T17:03:38+08:00",
"status": "SUCCESS",
"refundAmount": 10,
"totalAmount": 10,
"payerRefund": 10,
"payerTotal": 10,
"settlementAmount": 10,
"settlementTotal": 10,
"discountRefundAmount": 10,
"currency": "CNY",
"refundAccount": "REFUND_SOURCE_SUB_MERCHANT",
"fundsAccount": "string"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. weixinpay.test
Body
-
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
. -
transactionId string
Transaction ID
-
orderRef string Required
Merchant system order number
-
refundOrderRef string Required
Merchant refund order no
-
reason string
Refund message to customer
-
refundAmount number Required
Refund amount, unit is
fen
-
totalAmount number Required
The total order amount of the original payment, unit is
fen
-
currency string
Amount currency, available options: CNY
-
notifyUrl string
Notify url, receive notification of refund result of wechat Pay.
-
refundAccount string
Special parameters for refund of advance funds on e-commerce platform, REFUND_SOURCE_PARTNER_ADVANCE: advance payment is made by e-commerce platforms, which requires wechat Pay to apply for opening REFUND_SOURCE_SUB_MERCHANT: sub merchant, default value
Values are
REFUND_SOURCE_PARTNER_ADVANCE
orREFUND_SOURCE_SUB_MERCHANT
. -
fundsAccount string
If the order is profiting, this parameter is used
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/refund/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"paymentMethod":"wechatpay","transactionId":"4200001148202111020556019250","orderRef":"test20220125001","refundOrderRef":"r001test20220125001","reason":"商品已售完","refundAmount":10,"totalAmount":10,"currency":"CNY","notifyUrl":"https://www.weixin.qq.com","refundAccount":"REFUND_SOURCE_SUB_MERCHANT","fundsAccount":"string"}'
{
"paymentMethod": "wechatpay",
"transactionId": "4200001148202111020556019250",
"orderRef": "test20220125001",
"refundOrderRef": "r001test20220125001",
"reason": "商品已售完",
"refundAmount": 10,
"totalAmount": 10,
"currency": "CNY",
"notifyUrl": "https://www.weixin.qq.com",
"refundAccount": "REFUND_SOURCE_SUB_MERCHANT",
"fundsAccount": "string"
}
{
"code": 200,
"message": "success",
"refundId": "refund_id_payment_company",
"orderRef": "test20220125001",
"refundOrderRef": "r001test20220125001",
"transactionId": "4200001148202111020556019250",
"channel": "ORIGINAL",
"userReceivedAccount": "0403**",
"createTime": "2021-11-02T17:03:38+08:00",
"successTime": "2021-11-02T17:03:38+08:00",
"status": "SUCCESS",
"refundAmount": 10,
"totalAmount": 10,
"payerRefund": 10,
"payerTotal": 10,
"settlementAmount": 10,
"settlementTotal": 10,
"discountRefundAmount": 10,
"currency": "CNY",
"refundAccount": "REFUND_SOURCE_SUB_MERCHANT",
"fundsAccount": "string"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
settlement
The settlement services.
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Query parameters
-
profit_order_no string Required
The settlement order no of the merchant, shall be unique within merchant system
-
transaction_id string Required
Payment system internal order number
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X GET https://nomad.samarkand-global.cn/broker/v1/settlement/wechat.sh_smk?profit_order_no=string&transaction_id=string \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"outOrderNo": "string",
"transactionId": "transaction_id_123",
"orderId": "string",
"status": "FINISHED",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
],
"finishDescription": "string",
"finishAmount": 88
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
orderRef string Required
Merchant system settlemnt order number
-
transactionId string Required
Payment company transaction number
-
finish boolean | null
Whether the account distribution is completed. If it is false, the remaining amount of this order will not be unfrozen and returned to the secondary merchants, and the order can be divided again.
Default value is
false
. -
finishDesc string | null
Description for finishing profit orders
-
receivers array[object] | null
Receivers of the profit sharing.
-
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
.
curl \
-X PUT https://nomad.samarkand-global.cn/broker/v1/settlement/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"orderRef":"string","transactionId":"transaction_id_123","finish":false,"finishDesc":"分账完结","receivers":[{"type":"MERCHANT_ID","receiverAccount":"1900000109","name":"1900000109","amount":12,"paymentMethod":"wechatpay","description":"分帐1900000110","receiverMchid":"Orange","result":"SUCCESS","finishTime":"2015-05-20T13:29:35.120+08:00","failReason":"NO_RELATION","detailId":"3601111111111111111111"}],"paymentMethod":"wechatpay"}'
{
"orderRef": "string",
"transactionId": "transaction_id_123",
"finish": false,
"finishDesc": "分账完结",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
],
"paymentMethod": "wechatpay"
}
{
"code": 200,
"message": "success",
"outOrderNo": "string",
"transactionId": "transaction_id_123",
"orderId": "string",
"status": "FINISHED",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
],
"finishDescription": "string",
"finishAmount": 88
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
orderRef string Required
Merchant system settlemnt order number
-
transactionId string Required
Payment company transaction number
-
finish boolean | null
Whether the account distribution is completed. If it is false, the remaining amount of this order will not be unfrozen and returned to the secondary merchants, and the order can be divided again.
Default value is
false
. -
finishDesc string | null
Description for finishing profit orders
-
receivers array[object] | null
Receivers of the profit sharing.
-
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/settlement/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"orderRef":"string","transactionId":"transaction_id_123","finish":false,"finishDesc":"分账完结","receivers":[{"type":"MERCHANT_ID","receiverAccount":"1900000109","name":"1900000109","amount":12,"paymentMethod":"wechatpay","description":"分帐1900000110","receiverMchid":"Orange","result":"SUCCESS","finishTime":"2015-05-20T13:29:35.120+08:00","failReason":"NO_RELATION","detailId":"3601111111111111111111"}],"paymentMethod":"wechatpay"}'
{
"orderRef": "string",
"transactionId": "transaction_id_123",
"finish": false,
"finishDesc": "分账完结",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
],
"paymentMethod": "wechatpay"
}
{
"code": 200,
"message": "success",
"outOrderNo": "string",
"transactionId": "transaction_id_123",
"orderId": "string",
"status": "FINISHED",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
],
"finishDescription": "string",
"finishAmount": 88
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name, e.g. wechat.sh_smk
Query parameters
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X GET https://nomad.samarkand-global.cn/broker/v1/settlement/receiver/wechat.sh_smk \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"type": "MERCHANT_ID",
"account": "1900000109",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
]
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
type string
Receiver type of profit sharing. MERCHANT_ID: merchants, PERSONAL_OPENID: personal. PERSONAL_OPENID is not available
Values are
MERCHANT_ID
orPERSONAL_OPENID
. -
account string
The receiver account.
-
name string
The receiver name.
-
relationType string
Relationship between sub-merchant and recipient.
Values are
SUPPLIER
,DISTRIBUTOR
,SERVICE_PROVIDER
,PLATFORM
, orOTHERS
. -
encryptedName string
Ciphertext of individual name(verify if value is passed)
-
description string
The Settlement receiver description.
-
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/settlement/receiver/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"MERCHANT_ID","account":"1900000109","name":"张三","relationType":"OTHERS","encryptedName":"hu89ohu89ohu89o","description":"网络公司","paymentMethod":"wechatpay"}'
{
"type": "MERCHANT_ID",
"account": "1900000109",
"name": "张三",
"relationType": "OTHERS",
"encryptedName": "hu89ohu89ohu89o",
"description": "网络公司",
"paymentMethod": "wechatpay"
}
{
"code": 200,
"message": "success",
"type": "MERCHANT_ID",
"account": "1900000109",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
]
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Query parameters
-
type string Required
Receiver type of profit sharing. MERCHANT_ID: merchants, PERSONAL_OPENID: personal.
Values are
MERCHANT_ID
orPERSONAL_OPENID
. -
account string
The receiver account.
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X DELETE https://nomad.samarkand-global.cn/broker/v1/settlement/receiver/wechat.sh_smk?type=MERCHANT_ID \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"type": "MERCHANT_ID",
"account": "1900000109",
"receivers": [
{
"type": "MERCHANT_ID",
"receiverAccount": "1900000109",
"name": "1900000109",
"amount": 12,
"paymentMethod": "wechatpay",
"description": "分帐1900000110",
"receiverMchid": "Orange",
"result": "SUCCESS",
"finishTime": "2015-05-20T13:29:35.120+08:00",
"failReason": "NO_RELATION",
"detailId": "3601111111111111111111"
}
]
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
payout
Funds of merchant to oversea.
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Query parameters
-
out_order_id string Required
The payout number of the merchant, shall be generated by the merchant when initiating the payout request
-
transaction_id string Required
Payment system internal order number
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X GET https://nomad.samarkand-global.cn/broker/v1/payout/abroad/wechat.sh_smk?out_order_id=string&transaction_id=string \
-H "app-api-key: $API_KEY"
{
"code": 200,
"message": "success",
"outOrderId": "string",
"transactionId": "42000000000_123123",
"payoutOrderId": "string",
"result": "SUCCESS",
"failReason": "BALANCE_NOT_ENOUGH",
"amount": 88,
"foreignAmount": 88,
"foreignCurrency": 88,
"rate": 88,
"exchangeRateTime": "2015-05-20T13:29:35.120+08:00",
"estimateExchangeRateTime": "2015-05-20T13:29:35.120+08:00",
"availableAbroadAmount": 88
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
outOrderId string
The payout number of the merchant, shall be generated by the merchant when initiating the payout request
-
transactionId string
Payment company transaction number
-
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
. -
amount integer
Amount of RMB to be payout, unit is cent
-
foreignCurrency string
Currency of overseas payment. Note: The currency field is related to Payment company payee ID
-
goodsInfo array[object]
Goods information, the number cannot exceed 10
-
sellerInfo object
-
expressInfo object
-
payeeInfo object
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/payout/abroad/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"outOrderId":"string","transactionId":"transaction_id_123","paymentMethod":"wechatpay","amount":88,"foreignCurrency":"USD","goodsInfo":[{"goodsName":"Orange","goodsCategory":"health-beauty/fragrance","goodsUnitPrice":12,"goodsQuantity":1}],"sellerInfo":{"overseaBusinessName":"香港 xxxx 公司","overseaShopName":"香港 xxx 公司 xxx 店铺","sellerId":"id2123123123"},"expressInfo":{"courierNumber":"SF1341558741234","expressCompanyName":"国际 xxx 物流"},"payeeInfo":{"payeeId":"id123112312"}}'
{
"outOrderId": "string",
"transactionId": "transaction_id_123",
"paymentMethod": "wechatpay",
"amount": 88,
"foreignCurrency": "USD",
"goodsInfo": [
{
"goodsName": "Orange",
"goodsCategory": "health-beauty/fragrance",
"goodsUnitPrice": 12,
"goodsQuantity": 1
}
],
"sellerInfo": {
"overseaBusinessName": "香港 xxxx 公司",
"overseaShopName": "香港 xxx 公司 xxx 店铺",
"sellerId": "id2123123123"
},
"expressInfo": {
"courierNumber": "SF1341558741234",
"expressCompanyName": "国际 xxx 物流"
},
"payeeInfo": {
"payeeId": "id123112312"
}
}
{
"code": 200,
"message": "success",
"outOrderId": "string",
"transactionId": "42000000000_123123",
"payoutOrderId": "string",
"result": "SUCCESS",
"failReason": "BALANCE_NOT_ENOUGH",
"amount": 88,
"foreignAmount": 88,
"foreignCurrency": 88,
"rate": 88,
"exchangeRateTime": "2015-05-20T13:29:35.120+08:00",
"estimateExchangeRateTime": "2015-05-20T13:29:35.120+08:00",
"availableAbroadAmount": 88
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Query parameters
-
bill_date string Required
Bill date. Query format YYYY-MM-DD, for example, 2021-01-01
-
merchant_id string
Merchant ID of merchant.
-
payment_method string
Must be
wechatpay
oralipay
Values are
wechatpay
oralipay
.
curl \
-X GET https://nomad.samarkand-global.cn/broker/v1/payout/bill/abroad/{merchant}?bill_date=string \
-H "app-api-key: $API_KEY"
"@file"
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}
Path parameters
-
merchant string Required
Merchant name to payment company, e.g. wechat.sh_smk
Body
-
operation string Required
Abroad payout bill operations, available: GetAvailableAbroadAmounts
-
transactionId string Required
Payment company transaction number
-
paymentMethod string
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/payout/bill/abroad/{merchant} \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"GetAvailableAbroadAmounts","transactionId":"transaction_id_123","paymentMethod":"wechatpay"}'
{
"operation": "GetAvailableAbroadAmounts",
"transactionId": "transaction_id_123",
"paymentMethod": "wechatpay"
}
{
"code": 200,
"message": "success",
"outOrderId": "string",
"transactionId": "42000000000_123123",
"payoutOrderId": "string",
"result": "SUCCESS",
"failReason": "BALANCE_NOT_ENOUGH",
"amount": 88,
"foreignAmount": 88,
"foreignCurrency": 88,
"rate": 88,
"exchangeRateTime": "2015-05-20T13:29:35.120+08:00",
"estimateExchangeRateTime": "2015-05-20T13:29:35.120+08:00",
"availableAbroadAmount": 88
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}