# 订单备注
接口地址: http://www.damaijia168.com/vv/external/v1/requestTbErp/taobao-trade-memo-update
请求方式: POST
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| shop_id | String | 是 | 店铺 ID |
| params | Object | 是 | 参数 |
| tid | Number | 是 | 交易编号 |
| memo | string | 是 | 交易备注。最大长度: 1000 个字节 |
| flag | string | 否 | 交易备注旗帜,可选值为:0(灰色), 1(红色), 2(黄色), 3(绿色), 4(蓝色), 5(粉红色),默认值为 0 |
| edition | string | 否 | 版本 默认:1(不传默认为1) 1:1.0,2:2.0 |
# 请求示例
{
"shop_id":173926031,
"params":{
"tid": "123",
"memo": "交易备注",
"flag": "1"
}
}
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://www.damaijia168.com/vv/external/v1/requestTbErp/taobao-trade-memo-update' --header 'Authorization: 1798c6aadec33d1bc2f5b707f1049aefexxxx' --header 'Content-Type: application/json' --data-raw '{
"shopId": "123456789",
"tid": "123",
"memo": "交易备注",
"flag": "1"
}'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://www.damaijia168.com/vv/external/v1/requestTbErp/taobao-trade-memo-update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"shopId": "123456789",
"tid": "123",
"memo": "交易备注",
"flag": "1"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: 1798c6aadec33d1bc2f5b707f1049aefexxxx',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
JAVA请求代码示例
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"shopId\": \"123456789\",\r\n \"tid\": \"123\",\r\n \"memo\": \"交易备注\",\r\n \"flag\": \"1\"\r\n}");
Request request = new Request.Builder()
.url("http://www.damaijia168.com/vv/external/v1/requestTbErp/taobao-trade-memo-update")
.method("POST", body)
.addHeader("Authorization", "1798c6aadec33d1bc2f5b707f1049aefexxxx")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Pyton请求代码示例
import requests
url = "http://www.damaijia168.com/vv/external/v1/requestTbErp/taobao-trade-memo-update"
payload={
"shopId": "123456789",
"tid": "123",
"memo": "交易备注",
"flag": "1"
}
files=[
]
headers = {
'Authorization': '1798c6aadec33d1bc2f5b707f1049aefexxxx'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 返回数据 |
| ----tid | int | 交易编号 (父订单的交易编号) |
| ----created | Date | 交易创建时间。格式:yyyy-MM-dd HH:mm:ss |
| ----deduct_money | int | 消耗点券 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data": {
"modified": "2021-04-01 15:36:57",
"tid": "123456789"
},
"deduct_money": 4,
"status": 0
}
# 错误码
| 状态码(status) | 错误信息 | 解决方案 |
|---|---|---|
| 132 | 请求格式必须为JSON | 修改请求参数格式为json |
| 422 | 参数列表不合法,在err中会给出提示 | 根据提示做相应修改 |
| 200 | 认证失败 | 请确保请求头里的Authorization存在或者未过期 |
| 422 | 交易不存在 | 请填写正确的订单号 |
| 422 | 参数无效,格式不对、非法值、越界等 | 请填写正确的参赛 |
| 422 | 必须是此交易的卖家或买家才能添加交易备注 | 查看是否程序出问导致添加交易备注的交易不属于该卖家,出现错误不要重试 |
| 2011 | 店铺未授权 | 使用已授权店铺 |
| 2010 | 未知错误 请联系客服 | 联系客服 |