Product Order Interface
This interface is used to create or update product orders.
Request Method
POST /customer_orders
Request Parameters (Query String)
Parameter Name | Type | Required | Description | Restrictions |
---|
type | String | Yes | Required when retrieving a specified customer's order list, see values | |
content | String | Yes | Required when retrieving a specified customer's order list, see values | |
order | Order Object | Yes | Order information | |
Order Object
Parameter | Type | Required | Description |
---|
order_no | String | Yes | Order number |
name | String | Yes | Order name |
url | String | No | Order redirect link |
price | Decimal | Yes | Order price |
order_at | DateTime | Yes | Order placement time |
pay_at | DateTime | No | Payment time |
status | String | Yes | Order Status |
remark | String | No | Notes |
consignee_name | String | No | Consignee name |
consignee_phone | String | No | Consignee phone number |
consignee_address | String | No | Consignee address |
commodit_num | Numeric | No | Total number of products |
commodities | Array | No | Product Information Array(Object) |
Option Names and Values Description
option_name | Option Description | option_value | Option Value Description |
---|
status | Order Status | wait_pay | Awaiting Payment |
| | paid | Paid |
| | closed | Closed |
Product Information Object
Parameter Name | Type | Required | Description |
---|
commodit_name | String | No | Product name |
commodit_no | String | No | Product number |
commodit_count | Numeric | No | Product quantity |
commodit_fee | String | No | Product price |
Response Data
Attribute Name | Type | Description |
---|
code | Integer | Execution result code, 1000 represents success |
customer_exists | Boolean | Whether the customer exists in Udesk |
Example
Request
curl https://demo.udesk.cn/open_api_v1/customer_orders?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X PUT \
-H 'content-type:application/json' \
-d '
{
"type": "id",
"content": "8888",
"order": {
"order_no": "20190510",
"name": "Apple iPhone X (A1903) 64GB",
"url": "xxx",
"price": 8888.8,
"order_at": "2019-05-10 10:10:10",
"pay_at": "2019-05-10 10:15:10",
"status": "paid",
"remark": "xxxx",
"consignee_name": "Zhang San",
"consignee_phone": "01012345",
"consignee_address": "Beijing Daxing District",
"commodit_num": 88,
"commodities": [
{
"commodit_name": "Milk A",
"commodit_no": "NO123456",
"commodit_count": 1,
"commodit_fee": "46.5"
}
]
}'
Response
{
"code": 1000,
"customer_exists": true
}