# 物流信息上传2.1

## API

## 物流上传接口

<mark style="color:green;">`POST`</mark> `访问地址：/logistics`

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                          | Type   | Description                                  |
| --------------------------------------------- | ------ | -------------------------------------------- |
| sign<mark style="color:red;">\*</mark>        | string | 签名值                                          |
| signType<mark style="color:red;">\*</mark>    | string | 签名类型 MD5 / RSA (4)                           |
| echoParam                                     | string | 回声参数，Response 中将会原样返回 (256)                  |
| courierInfo<mark style="color:red;">\*</mark> | array  | json string, 数组类型的字符串，物流详细信息, 请参考courierInfo |
| reference<mark style="color:red;">\*</mark>   | string | useepay订单号, 需要唯一 (64)                        |
| merchantNo<mark style="color:red;">\*</mark>  | string | 商户号 (16)                                     |
| version<mark style="color:red;">\*</mark>     | string | 目前固定为 2.1 (5)                                |
| transactionType                               | String | max=18 交易类型：save                             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

courierInfo

| 字段            | 长度      | 描述     | 是否必要 |
| ------------- | ------- | ------ | ---- |
| courierNumber | max=64  | 物流编号   | yes  |
| url           | max=256 | 物流查询网址 | yes  |
| courierCode   | max=32  | 物流公司编码 | yes  |

## Result

{% tabs %}
{% tab title="Request" %}
curl BASE\_URL + '/logistics'

\
-H 'Connection: keep-alive'\
-H 'Content-Type: application/x-www-form-urlencoded'\
\
\--data-raw 'courierInfo=\[{"courierCode":"others","courierNumber":"A111111111","url":"[www.baidu.com"}\]\&merchantNo=500000000007362\&reference=1012212071430678654\&sign=0a363603439ae81e65e5d5b7396f0d44\&signType=MD5\&transactionType=save\&version=2.1](https://useepay.gitbook.io/developer/reference/wu-liu-jie-kou/upload/http:/www.baidu.com"}]\&merchantNo=500000000007362\&reference=1012212071430678654\&sign=0a363603439ae81e65e5d5b7396f0d44\&signType=MD5\&transactionType=save\&version=2.1)'\
\--compressed
{% endtab %}

{% tab title="Success Response" %}

```
{
    "echoParam": "echoParam",
    "reference": "44543463463463",
    "errorCode": "0000",
    "errorMsg": "Approved or completed successfully",
    "merchantNo": "500000000007381",
    "resultCode": "succeed",
    "sign": "1aab1771d7846efb74edb801a0fd772d",
    "signType": "MD5"
}
```

| 字段           | 长度      | 描述                                                    | 是否必要 |
| ------------ | ------- | ----------------------------------------------------- | ---- |
| merchantNo   | max=16  | max=16 商户编号，由 USEEPAY 分配                              | yes  |
| reference    | max=64  | UseePay返回的交易流水号（交易时产生）                                |      |
| resultCode   | max=32  | <ul><li>failed: 上传失败 </li><li>succeed: 上传成功</li></ul> | yes  |
| errorCode    | max=4   | 错误码（详见 错误码errorCode）                                  |      |
| errorMsg     | max=256 | 错误码消息描述                                               |      |
| echoParam    | max=256 | 回声参数，响应报文会原样返回                                        |      |
| sign         | max=256 | 签名                                                    | yes  |
| {% endtab %} |         |                                                       |      |

{% tab title="Failed Response" %}

{% endtab %}
{% endtabs %}
