---
title: "创建履约发货物流事件"
description: "创建物流跟踪事件"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/shipping-and-fulfillment/create-fulfillment-shipping-logistics-event'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/shipping-and-fulfillment/create-fulfillment-shipping-logistics-event.md'
---
# 创建履约发货物流事件

创建物流跟踪事件

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_assigned_fulfillment_orders`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /fulfillments/:order_id/:fulfillment_id/events/create.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `write_assigned_fulfillment_orders`

## Request

### Path Parameters

* `fulfillment_id`

  string (required)

  发货单id

* `order_id`

  string (required)

  订单id

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

### Request Body

* `status`

  string

  状态，包括：label_printed、label_purchased、attempted_delivery、ready_for_pickup、picked_up、confirmed、in_transit、out_for_delivery、delivered、failure

* `longitude`

  string

  经度

* `message`

  string

  备注，最大长度为512

* `country`

  string

  国家

* `zip`

  string

  邮编

* `city`

  string

  城市

* `province`

  string

  省份

* `estimated_delivery_at`

  string

  预计送货时间（格式见ISO 8601）

* `happened_at`

  string

  事件发生时间（格式见ISO 8601）

* `address`

  string

  地址

* `latitude`

  string

  纬度

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `fulfillment_event`

  object

  事件信息

  * `city`

    string

    城市

  * `shop_id`

    string

    店铺id

  * `latitude`

    string

    纬度

  * `order_id`

    string

    订单id

  * `province`

    string

    省份

  * `address`

    string

    地址

  * `country`

    string

    国家

  * `estimated_delivery_at`

    string

    预计送货时间（格式见ISO 8601）

  * `longitude`

    string

    经度

  * `status`

    string

    状态，包括：label_printed、label_purchased、attempted_delivery、ready_for_pickup、picked_up、confirmed、in_transit、out_for_delivery、delivered、failure

  * `message`

    string

    备注

  * `update_at`

    string

    更新时间

  * `create_at`

    string

    创建时间

  * `id`

    string

    事件id

  * `zip`

    string

    邮编

  * `fulfillment_id`

    string

    发货单id

  * `happened_at`

    string

    事件发生时间（格式见ISO 8601）


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "创建物流跟踪事件",
  "externalDocs": {
    "description": "接口使用的权限点: `write_assigned_fulfillment_orders` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "jTY9mRXF",
  "parameters": [
    {
      "name": "fulfillment_id",
      "in": "path",
      "description": "发货单id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "fulfillment_id",
        "description": "发货单id",
        "type": "string",
        "example": "22060720884441337538627925"
      },
      "example": "22060720884441337538627925"
    },
    {
      "name": "order_id",
      "in": "path",
      "description": "订单id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "order_id",
        "description": "订单id",
        "type": "string",
        "example": "21056024607602932623437925"
      },
      "example": "21056024607602932623437925"
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。请参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "status": {
              "name": "status",
              "description": "状态，包括：label_printed、label_purchased、attempted_delivery、ready_for_pickup、picked_up、confirmed、in_transit、out_for_delivery、delivered、failure",
              "type": "string",
              "example": "label_printed"
            },
            "longitude": {
              "name": "longitude",
              "description": "经度",
              "type": "string",
              "example": "113.301255"
            },
            "message": {
              "name": "message",
              "description": "备注，最大长度为512",
              "type": "string",
              "example": "nothing"
            },
            "country": {
              "name": "country",
              "description": "国家",
              "type": "string",
              "example": "Canada"
            },
            "zip": {
              "name": "zip",
              "description": "邮编",
              "type": "string",
              "example": "A1B 2C3"
            },
            "city": {
              "name": "city",
              "description": "城市",
              "type": "string",
              "example": "Ottawa"
            },
            "province": {
              "name": "province",
              "description": "省份",
              "type": "string",
              "example": "Ontario"
            },
            "estimated_delivery_at": {
              "name": "estimated_delivery_at",
              "description": "预计送货时间（格式见ISO 8601）",
              "type": "string",
              "example": "2021-08-16T08:27:57+00:00"
            },
            "happened_at": {
              "name": "happened_at",
              "description": "事件发生时间（格式见ISO 8601）",
              "type": "string",
              "example": "2021-08-16T08:27:57+00:00"
            },
            "address": {
              "name": "address",
              "description": "地址",
              "type": "string",
              "example": "126 York Street"
            },
            "latitude": {
              "name": "latitude",
              "description": "纬度",
              "type": "string",
              "example": "23.32947"
            }
          },
          "required": [
            "status"
          ],
          "example": {
            "message": "nothing",
            "address": "126 York Street",
            "happened_at": "2021-08-16T08:27:57+00:00",
            "status": "label_printed",
            "estimated_delivery_at": "2021-08-16T08:27:57+00:00",
            "latitude": "23.32947",
            "province": "Ontario",
            "zip": "A1B 2C3",
            "longitude": "113.301255",
            "city": "Ottawa",
            "country": "Canada"
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "fulfillment_event": {
                "name": "fulfillment_event",
                "description": "事件信息",
                "type": "object",
                "properties": {
                  "city": {
                    "name": "city",
                    "description": "城市",
                    "type": "string",
                    "example": "Ottawa"
                  },
                  "shop_id": {
                    "name": "shop_id",
                    "description": "店铺id",
                    "type": "string",
                    "example": "2331445"
                  },
                  "latitude": {
                    "name": "latitude",
                    "description": "纬度",
                    "type": "string",
                    "example": "23.32947"
                  },
                  "order_id": {
                    "name": "order_id",
                    "description": "订单id",
                    "type": "string",
                    "example": "21056024607602932623437925"
                  },
                  "province": {
                    "name": "province",
                    "description": "省份",
                    "type": "string",
                    "example": "Ontario"
                  },
                  "address": {
                    "name": "address",
                    "description": "地址",
                    "type": "string",
                    "example": "126 York Street"
                  },
                  "country": {
                    "name": "country",
                    "description": "国家",
                    "type": "string",
                    "example": "Canada"
                  },
                  "estimated_delivery_at": {
                    "name": "estimated_delivery_at",
                    "description": "预计送货时间（格式见ISO 8601）",
                    "type": "string",
                    "example": "2021-08-16T08:27:57+00:00"
                  },
                  "longitude": {
                    "name": "longitude",
                    "description": "经度",
                    "type": "string",
                    "example": "113.301255"
                  },
                  "status": {
                    "name": "status",
                    "description": "状态，包括：label_printed、label_purchased、attempted_delivery、ready_for_pickup、picked_up、confirmed、in_transit、out_for_delivery、delivered、failure",
                    "type": "string",
                    "example": "label_printed"
                  },
                  "message": {
                    "name": "message",
                    "description": "备注",
                    "type": "string",
                    "example": "nothing"
                  },
                  "update_at": {
                    "name": "update_at",
                    "description": "更新时间",
                    "type": "string",
                    "example": "2021-08-16T08:27:57+00:00"
                  },
                  "create_at": {
                    "name": "create_at",
                    "description": "创建时间",
                    "type": "string",
                    "example": "2021-08-16T08:27:57+00:00"
                  },
                  "id": {
                    "name": "id",
                    "description": "事件id",
                    "type": "string",
                    "example": "4206234611998187371524"
                  },
                  "zip": {
                    "name": "zip",
                    "description": "邮编",
                    "type": "string",
                    "example": "A1B 2C3"
                  },
                  "fulfillment_id": {
                    "name": "fulfillment_id",
                    "description": "发货单id",
                    "type": "string",
                    "example": "22060720884441337538627925"
                  },
                  "happened_at": {
                    "name": "happened_at",
                    "description": "事件发生时间（格式见ISO 8601）",
                    "type": "string",
                    "example": "2021-08-16T08:27:57+00:00"
                  }
                },
                "example": {
                  "happened_at": "2021-08-16T08:27:57+00:00",
                  "longitude": "113.301255",
                  "update_at": "2021-08-16T08:27:57+00:00",
                  "status": "label_printed",
                  "address": "126 York Street",
                  "province": "Ontario",
                  "shop_id": "2331445",
                  "create_at": "2021-08-16T08:27:57+00:00",
                  "fulfillment_id": "22060720884441337538627925",
                  "id": "4206234611998187371524",
                  "zip": "A1B 2C3",
                  "city": "Ottawa",
                  "country": "Canada",
                  "latitude": "23.32947",
                  "order_id": "21056024607602932623437925",
                  "estimated_delivery_at": "2021-08-16T08:27:57+00:00",
                  "message": "nothing"
                }
              }
            },
            "example": {
              "fulfillment_event": {
                "estimated_delivery_at": "2021-08-16T08:27:57+00:00",
                "zip": "A1B 2C3",
                "fulfillment_id": "22060720884441337538627925",
                "update_at": "2021-08-16T08:27:57+00:00",
                "longitude": "113.301255",
                "message": "nothing",
                "status": "label_printed",
                "happened_at": "2021-08-16T08:27:57+00:00",
                "create_at": "2021-08-16T08:27:57+00:00",
                "country": "Canada",
                "address": "126 York Street",
                "latitude": "23.32947",
                "id": "4206234611998187371524",
                "order_id": "21056024607602932623437925",
                "shop_id": "2331445",
                "province": "Ontario",
                "city": "Ottawa"
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/fulfillments/:order_id/:fulfillment_id/events/create.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "创建履约发货物流事件",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_assigned_fulfillment_orders"
  ]
}
```