New enterprise cart
POST
/carts/enterprise/{enterpriseId}/merchants/{merchantId}
New enterprise cart
Path parameters
-
merchantId string Required
Globally unique id for merchant
-
enterpriseId string Required
Issued unique enterprised ID
Body
Create new cart details
POST /carts/enterprise/{enterpriseId}/merchants/{merchantId}
curl \
-X POST https://nomad.samarkand-global.cn/checkout/carts/enterprise/REC890/merchants/SMK474 \
-H "x-ca-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"cancelUrl":"https://smktestpartner.myshopify.com/cancel","cart":{"user":{"platformUserId":"12345","payer":{"nationalId":"120103198806018241","name":"王小明","phoneNumber":"13887342813"},"shippingAddress":{"receiver":{"name":"王小明","phoneNumber":"13887342813"},"streetAddress":"天钥桥路333号腾飞大厦3楼438室","district":"徐汇区","province":"上海市","city":"市辖区","country":"中国","postcode":"200030"}},"paymentType":"alipay","products":[{"productId":"123456","skuNumber":"SMK123","barcode":"1234567890","quantity":1,"priceBeforeTax":10,"discount":0,"taxRate":"9.1,","imageUrl":"https://mydomain.com/image.png"}],"totalPriceBeforeShippingTaxAndDiscount":10,"currency":"CNY","tax":0.91,"shipping":20.2,"discount":30.3,"totalToPay":9}}'
Request example
{
"cancelUrl": "https://smktestpartner.myshopify.com/cancel",
"cart": {
"user": {
"platformUserId": "12345",
"payer": {
"nationalId": "120103198806018241",
"name": "王小明",
"phoneNumber": "13887342813"
},
"shippingAddress": {
"receiver": {
"name": "王小明",
"phoneNumber": "13887342813"
},
"streetAddress": "天钥桥路333号腾飞大厦3楼438室",
"district": "徐汇区",
"province": "上海市",
"city": "市辖区",
"country": "中国",
"postcode": "200030"
}
},
"paymentType": "alipay",
"products": [
{
"productId": "123456",
"skuNumber": "SMK123",
"barcode": "1234567890",
"quantity": 1,
"priceBeforeTax": 10,
"discount": 0,
"taxRate": "9.1,",
"imageUrl": "https://mydomain.com/image.png"
}
],
"totalPriceBeforeShippingTaxAndDiscount": 10,
"currency": "CNY",
"tax": 0.91,
"shipping": 20.2,
"discount": 30.3,
"totalToPay": 9
}
}
Response example (200)
{
"code": 42,
"message": "Status of operation",
"data": {
"cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
"exchangeRate": 9.1
}
}
Response example (400)
{
"code": 42,
"message": "Status of operation",
"data": {
"cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
"exchangeRate": 9.1
}
}
Response example (500)
{
"code": 42,
"message": "Status of operation",
"data": {
"cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
"exchangeRate": 9.1
}
}