---
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/cancel-shipping'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/shipping-and-fulfillment/cancel-shipping.md'
---
# 取消发货

订单取消发货

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

## Endpoint

```http
POST /orders/:order_id/fulfillments/:fulfillment_id/cancel.json
```

## Base URL

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

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

## Required Permissions

* `write_orders`

## Request

### Path Parameters

* `fulfillment_id`

  string (required)

  包裹id

* `order_id`

  string (required)

  订单号

### 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 格式传入。

## 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`

  object

  包裹信息

  * `tracking_urls`

    array<string>

    物流追踪URL组

  * `name`

    string

    包裹

  * `updated_at`

    string

    更新时间

  * `order_id`

    string

    订单号

  * `tracking_company`

    string

    物流公司名称

  * `created_at`

    string

    创建日期

  * `line_items`

    array<object>

    商品组

    * `total_discount_set`

      object

      多币种优惠

      * `shop_money`

        object

        店铺币种

      * `presentment_money`

        object

        结算币种

    * `requires_shipping`

      boolean

      是否需要发货

    * `tax_lines`

      array<object>

      税

      * `price`

        string

        金额

      * `price_set`

        object

        多币种金额

      * `rate`

        string

        税率

      * `title`

        string

        税名称

    * `product_id`

      string

      商品id

    * `grams`

      double

      重量

    * `variant_id`

      string

      商品变体ID

    * `total_discount`

      string

      优惠金额

    * `id`

      string

      商品ID

    * `price_set`

      object

      多币种价格

      * `shop_money`

        object

        店铺币种

      * `presentment_money`

        object

        结算币种

    * `name`

      string

      商品名称

    * `fulfillable_quantity`

      integer

      可发货数量

    * `version`

      string

      商品版本

    * `fulfillment_quantity`

      integer

      发货数量

    * `price`

      string

      价格

    * `title`

      string

      商品标题

    * `quantity`

      integer

      商品发货数量

    * `taxable`

      boolean

      是否收税

    * `sku`

      string

      商品货号

    * `variant_title`

      string

      商品变体名称

  * `status`

    string

    包裹状态

  * `tracking_number`

    string

    运单号

  * `id`

    string

    包裹ID

  * `tracking_numbers`

    array<string>

    运单号数组

  * `tracking_url`

    string

    物流追踪URL


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "订单取消发货",
  "externalDocs": {
    "description": "接口使用的权限点: `write_orders` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "1GKGAglc",
  "parameters": [
    {
      "name": "fulfillment_id",
      "in": "path",
      "description": "包裹id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "fulfillment_id",
        "description": "包裹id",
        "type": "string",
        "example": ""
      },
      "example": ""
    },
    {
      "name": "order_id",
      "in": "path",
      "description": "订单号",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "order_id",
        "description": "订单号",
        "type": "string",
        "example": ""
      },
      "example": ""
    },
    {
      "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"
    }
  ],
  "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": {
                "name": "fulfillment",
                "description": "包裹信息",
                "type": "object",
                "properties": {
                  "tracking_urls": {
                    "name": "tracking_urls",
                    "description": "物流追踪URL组",
                    "type": "array",
                    "items": {
                      "name": "tracking_urls",
                      "description": "物流追踪URL组",
                      "type": "string",
                      "example": ""
                    },
                    "example": [
                      ""
                    ]
                  },
                  "name": {
                    "name": "name",
                    "description": "包裹",
                    "type": "string",
                    "example": "e.g. #1001.1, #1001.2"
                  },
                  "updated_at": {
                    "name": "updated_at",
                    "description": "更新时间",
                    "type": "string",
                    "example": ""
                  },
                  "order_id": {
                    "name": "order_id",
                    "description": "订单号",
                    "type": "string",
                    "example": ""
                  },
                  "tracking_company": {
                    "name": "tracking_company",
                    "description": "物流公司名称",
                    "type": "string",
                    "example": ""
                  },
                  "created_at": {
                    "name": "created_at",
                    "description": "创建日期",
                    "type": "string",
                    "example": ""
                  },
                  "line_items": {
                    "name": "line_items",
                    "description": "商品组",
                    "type": "array",
                    "items": {
                      "name": "line_items",
                      "description": "商品组",
                      "type": "object",
                      "properties": {
                        "total_discount_set": {
                          "name": "total_discount_set",
                          "description": "多币种优惠",
                          "type": "object",
                          "properties": {
                            "shop_money": {
                              "name": "shop_money",
                              "description": "店铺币种",
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "name": "amount",
                                  "description": "金额",
                                  "type": "string",
                                  "example": ""
                                },
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "币种",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "amount": "",
                                "currency_code": ""
                              }
                            },
                            "presentment_money": {
                              "name": "presentment_money",
                              "description": "结算币种",
                              "type": "object",
                              "properties": {
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "币种",
                                  "type": "string",
                                  "example": ""
                                },
                                "amount": {
                                  "name": "amount",
                                  "description": "金额",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "amount": "",
                                "currency_code": ""
                              }
                            }
                          },
                          "example": {
                            "shop_money": {
                              "amount": "",
                              "currency_code": ""
                            },
                            "presentment_money": {
                              "amount": "",
                              "currency_code": ""
                            }
                          }
                        },
                        "requires_shipping": {
                          "name": "requires_shipping",
                          "description": "是否需要发货",
                          "type": "boolean",
                          "example": false
                        },
                        "tax_lines": {
                          "name": "tax_lines",
                          "description": "税",
                          "type": "array",
                          "items": {
                            "name": "tax_lines",
                            "description": "税",
                            "type": "object",
                            "properties": {
                              "price": {
                                "name": "price",
                                "description": "金额",
                                "type": "string",
                                "example": ""
                              },
                              "price_set": {
                                "name": "price_set",
                                "description": "多币种金额",
                                "type": "object",
                                "properties": {
                                  "presentment_money": {
                                    "name": "presentment_money",
                                    "description": "结算币种",
                                    "type": "object",
                                    "properties": {
                                      "currency_code": {
                                        "name": "currency_code",
                                        "description": "币种",
                                        "type": "string",
                                        "example": ""
                                      },
                                      "amount": {
                                        "name": "amount",
                                        "description": "金额",
                                        "type": "string",
                                        "example": ""
                                      }
                                    },
                                    "example": {
                                      "currency_code": "",
                                      "amount": ""
                                    }
                                  },
                                  "shop_money": {
                                    "name": "shop_money",
                                    "description": "店铺币种",
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "name": "amount",
                                        "description": "金额",
                                        "type": "string",
                                        "example": ""
                                      },
                                      "currency_code": {
                                        "name": "currency_code",
                                        "description": "币种",
                                        "type": "string",
                                        "example": ""
                                      }
                                    },
                                    "example": {
                                      "amount": "",
                                      "currency_code": ""
                                    }
                                  }
                                },
                                "example": {
                                  "presentment_money": {
                                    "amount": "",
                                    "currency_code": ""
                                  },
                                  "shop_money": {
                                    "amount": "",
                                    "currency_code": ""
                                  }
                                }
                              },
                              "rate": {
                                "name": "rate",
                                "description": "税率",
                                "type": "string",
                                "example": ""
                              },
                              "title": {
                                "name": "title",
                                "description": "税名称",
                                "type": "string",
                                "example": ""
                              }
                            },
                            "example": {
                              "price_set": {
                                "presentment_money": {
                                  "currency_code": "",
                                  "amount": ""
                                },
                                "shop_money": {
                                  "currency_code": "",
                                  "amount": ""
                                }
                              },
                              "rate": "",
                              "title": "",
                              "price": ""
                            }
                          },
                          "example": [
                            {
                              "title": "",
                              "price": "",
                              "price_set": {
                                "presentment_money": {
                                  "amount": "",
                                  "currency_code": ""
                                },
                                "shop_money": {
                                  "currency_code": "",
                                  "amount": ""
                                }
                              },
                              "rate": ""
                            }
                          ]
                        },
                        "product_id": {
                          "name": "product_id",
                          "description": "商品id",
                          "type": "string",
                          "example": ""
                        },
                        "grams": {
                          "name": "grams",
                          "description": "重量",
                          "type": "double",
                          "example": 0
                        },
                        "variant_id": {
                          "name": "variant_id",
                          "description": "商品变体ID",
                          "type": "string",
                          "example": ""
                        },
                        "total_discount": {
                          "name": "total_discount",
                          "description": "优惠金额",
                          "type": "string",
                          "example": ""
                        },
                        "id": {
                          "name": "id",
                          "description": "商品ID",
                          "type": "string",
                          "example": ""
                        },
                        "price_set": {
                          "name": "price_set",
                          "description": "多币种价格",
                          "type": "object",
                          "properties": {
                            "shop_money": {
                              "name": "shop_money",
                              "description": "店铺币种",
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "name": "amount",
                                  "description": "金额",
                                  "type": "string",
                                  "example": ""
                                },
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "币种",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "currency_code": "",
                                "amount": ""
                              }
                            },
                            "presentment_money": {
                              "name": "presentment_money",
                              "description": "结算币种",
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "name": "amount",
                                  "description": "金额",
                                  "type": "string",
                                  "example": ""
                                },
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "币种",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "amount": "",
                                "currency_code": ""
                              }
                            }
                          },
                          "example": {
                            "shop_money": {
                              "amount": "",
                              "currency_code": ""
                            },
                            "presentment_money": {
                              "amount": "",
                              "currency_code": ""
                            }
                          }
                        },
                        "name": {
                          "name": "name",
                          "description": "商品名称",
                          "type": "string",
                          "example": ""
                        },
                        "fulfillable_quantity": {
                          "name": "fulfillable_quantity",
                          "description": "可发货数量",
                          "type": "integer",
                          "example": 0
                        },
                        "version": {
                          "name": "version",
                          "description": "商品版本",
                          "type": "string",
                          "example": ""
                        },
                        "fulfillment_quantity": {
                          "name": "fulfillment_quantity",
                          "description": "发货数量",
                          "type": "integer",
                          "example": 1
                        },
                        "price": {
                          "name": "price",
                          "description": "价格",
                          "type": "string",
                          "example": ""
                        },
                        "title": {
                          "name": "title",
                          "description": "商品标题",
                          "type": "string",
                          "example": ""
                        },
                        "quantity": {
                          "name": "quantity",
                          "description": "商品发货数量",
                          "type": "integer",
                          "example": 0
                        },
                        "taxable": {
                          "name": "taxable",
                          "description": "是否收税",
                          "type": "boolean",
                          "example": false
                        },
                        "sku": {
                          "name": "sku",
                          "description": "商品货号",
                          "type": "string",
                          "example": ""
                        },
                        "variant_title": {
                          "name": "variant_title",
                          "description": "商品变体名称",
                          "type": "string",
                          "example": ""
                        }
                      },
                      "example": {
                        "title": "",
                        "tax_lines": [
                          {
                            "title": "",
                            "price": "",
                            "price_set": {
                              "presentment_money": {
                                "amount": "",
                                "currency_code": ""
                              },
                              "shop_money": {
                                "amount": "",
                                "currency_code": ""
                              }
                            },
                            "rate": ""
                          }
                        ],
                        "total_discount_set": {
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "shop_money": {
                            "amount": "",
                            "currency_code": ""
                          }
                        },
                        "variant_title": "",
                        "taxable": false,
                        "id": "",
                        "sku": "",
                        "fulfillable_quantity": 0,
                        "total_discount": "",
                        "version": "",
                        "price_set": {
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "shop_money": {
                            "amount": "",
                            "currency_code": ""
                          }
                        },
                        "requires_shipping": false,
                        "fulfillment_quantity": 1,
                        "price": "",
                        "quantity": 0,
                        "grams": 0,
                        "name": "",
                        "product_id": "",
                        "variant_id": ""
                      }
                    },
                    "example": [
                      {
                        "sku": "",
                        "price_set": {
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "shop_money": {
                            "currency_code": "",
                            "amount": ""
                          }
                        },
                        "tax_lines": [
                          {
                            "price": "",
                            "price_set": {
                              "shop_money": {
                                "amount": "",
                                "currency_code": ""
                              },
                              "presentment_money": {
                                "amount": "",
                                "currency_code": ""
                              }
                            },
                            "rate": "",
                            "title": ""
                          }
                        ],
                        "fulfillable_quantity": 0,
                        "title": "",
                        "taxable": false,
                        "requires_shipping": false,
                        "version": "",
                        "variant_title": "",
                        "fulfillment_quantity": 1,
                        "product_id": "",
                        "quantity": 0,
                        "name": "",
                        "total_discount_set": {
                          "presentment_money": {
                            "currency_code": "",
                            "amount": ""
                          },
                          "shop_money": {
                            "amount": "",
                            "currency_code": ""
                          }
                        },
                        "id": "",
                        "grams": 0,
                        "total_discount": "",
                        "price": "",
                        "variant_id": ""
                      }
                    ]
                  },
                  "status": {
                    "name": "status",
                    "description": "包裹状态",
                    "type": "string",
                    "example": ""
                  },
                  "tracking_number": {
                    "name": "tracking_number",
                    "description": "运单号",
                    "type": "string",
                    "example": ""
                  },
                  "id": {
                    "name": "id",
                    "description": "包裹ID",
                    "type": "string",
                    "example": ""
                  },
                  "tracking_numbers": {
                    "name": "tracking_numbers",
                    "description": "运单号数组",
                    "type": "array",
                    "items": {
                      "name": "tracking_numbers",
                      "description": "运单号数组",
                      "type": "string",
                      "example": ""
                    },
                    "example": [
                      ""
                    ]
                  },
                  "tracking_url": {
                    "name": "tracking_url",
                    "description": "物流追踪URL",
                    "type": "string",
                    "example": ""
                  }
                },
                "example": {
                  "tracking_company": "",
                  "id": "",
                  "name": "e.g. #1001.1, #1001.2",
                  "created_at": "",
                  "tracking_url": "",
                  "updated_at": "",
                  "line_items": [
                    {
                      "version": "",
                      "fulfillment_quantity": 1,
                      "sku": "",
                      "tax_lines": [
                        {
                          "price": "",
                          "price_set": {
                            "presentment_money": {
                              "amount": "",
                              "currency_code": ""
                            },
                            "shop_money": {
                              "currency_code": "",
                              "amount": ""
                            }
                          },
                          "rate": "",
                          "title": ""
                        }
                      ],
                      "variant_id": "",
                      "title": "",
                      "price": "",
                      "variant_title": "",
                      "requires_shipping": false,
                      "total_discount_set": {
                        "presentment_money": {
                          "currency_code": "",
                          "amount": ""
                        },
                        "shop_money": {
                          "amount": "",
                          "currency_code": ""
                        }
                      },
                      "total_discount": "",
                      "fulfillable_quantity": 0,
                      "taxable": false,
                      "price_set": {
                        "shop_money": {
                          "currency_code": "",
                          "amount": ""
                        },
                        "presentment_money": {
                          "amount": "",
                          "currency_code": ""
                        }
                      },
                      "quantity": 0,
                      "name": "",
                      "id": "",
                      "product_id": "",
                      "grams": 0
                    }
                  ],
                  "order_id": "",
                  "tracking_number": "",
                  "tracking_numbers": [
                    ""
                  ],
                  "status": "",
                  "tracking_urls": [
                    ""
                  ]
                }
              }
            },
            "example": {
              "fulfillment": {
                "created_at": "",
                "status": "",
                "tracking_company": "",
                "tracking_numbers": [
                  ""
                ],
                "updated_at": "",
                "name": "e.g. #1001.1, #1001.2",
                "tracking_number": "",
                "order_id": "",
                "tracking_url": "",
                "tracking_urls": [
                  ""
                ],
                "id": "",
                "line_items": [
                  {
                    "price": "",
                    "price_set": {
                      "shop_money": {
                        "amount": "",
                        "currency_code": ""
                      },
                      "presentment_money": {
                        "amount": "",
                        "currency_code": ""
                      }
                    },
                    "version": "",
                    "requires_shipping": false,
                    "taxable": false,
                    "title": "",
                    "product_id": "",
                    "total_discount": "",
                    "fulfillable_quantity": 0,
                    "variant_title": "",
                    "fulfillment_quantity": 1,
                    "grams": 0,
                    "tax_lines": [
                      {
                        "price_set": {
                          "shop_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          }
                        },
                        "rate": "",
                        "title": "",
                        "price": ""
                      }
                    ],
                    "sku": "",
                    "total_discount_set": {
                      "shop_money": {
                        "currency_code": "",
                        "amount": ""
                      },
                      "presentment_money": {
                        "currency_code": "",
                        "amount": ""
                      }
                    },
                    "name": "",
                    "quantity": 0,
                    "id": "",
                    "variant_id": ""
                  }
                ]
              }
            }
          }
        }
      }
    },
    "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": "/orders/:order_id/fulfillments/:fulfillment_id/cancel.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_orders"
  ]
}
```