---
title: "Cancel shipping"
description: "Order shipment cancellation"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/order/shipping-and-fulfillment/cancel-shipping'
  md: 'https://developer.shopline.com/docs/admin-rest-api/order/shipping-and-fulfillment/cancel-shipping.md'
---
# Cancel shipping

Order shipment cancellation

- **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` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `write_orders`

## Request

### Path Parameters

* `fulfillment_id`

  string (required)

  Package id

* `order_id`

  string (required)

  Order number

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `fulfillment`

  object

  Package information

  * `updated_at`

    string

    Update time

  * `tracking_number`

    string

    Tracking number

  * `tracking_numbers`

    array<string>

    Tracking number array

  * `name`

    string

    Package

  * `tracking_url`

    string

    Logistics tracking URL

  * `status`

    string

    Package tracking

  * `created_at`

    string

    Creation date

  * `tracking_urls`

    array<string>

    Logistics tracking URL group

  * `order_id`

    string

    Order number

  * `id`

    string

    Package ID

  * `tracking_company`

    string

    Logistics company name

  * `line_items`

    array<object>

    Item group

    * `requires_shipping`

      boolean

      Shipping or not

    * `taxable`

      boolean

      Tax or not？

    * `tax_lines`

      array<object>

      Tax

      * `rate`

        string

        Tax rate

      * `title`

        string

        Tax name

      * `price`

        string

        Amount

      * `price_set`

        object

        Multi-currency amount

    * `quantity`

      integer

      Product quantity shipped

    * `fulfillable_quantity`

      integer

      Available quantity

    * `sku`

      string

      Product code

    * `grams`

      double

      Weight

    * `title`

      string

      Product title

    * `price_set`

      object

      Multi-currency prices

      * `presentment_money`

        object

        Settlement currency

      * `shop_money`

        object

        Store currency

    * `total_discount_set`

      object

      Multi-currency discount

      * `shop_money`

        object

        Store currency

      * `presentment_money`

        object

        Settlement currency

    * `version`

      string

      Product version

    * `variant_id`

      string

      Product variant ID

    * `product_id`

      string

      Product ID

    * `fulfillment_quantity`

      integer

      Shipping quantity

    * `id`

      string

      Product ID

    * `total_discount`

      string

      Discount amount

    * `name`

      string

      Product name

    * `price`

      string

      Price

    * `variant_title`

      string

      Product variant name


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "description": "Order shipment cancellation",
  "externalDocs": {
    "description": "Permission point used by the interface is `write_orders` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "1GKGAglc",
  "parameters": [
    {
      "name": "fulfillment_id",
      "in": "path",
      "description": "Package id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "fulfillment_id",
        "description": "Package id",
        "type": "string",
        "example": ""
      },
      "example": ""
    },
    {
      "name": "order_id",
      "in": "path",
      "description": "Order number",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "order_id",
        "description": "Order number",
        "type": "string",
        "example": ""
      },
      "example": ""
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `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": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API. Please refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "fulfillment": {
                "name": "fulfillment",
                "description": "Package information",
                "type": "object",
                "properties": {
                  "updated_at": {
                    "name": "updated_at",
                    "description": "Update time",
                    "type": "string",
                    "example": ""
                  },
                  "tracking_number": {
                    "name": "tracking_number",
                    "description": "Tracking number",
                    "type": "string",
                    "example": ""
                  },
                  "tracking_numbers": {
                    "name": "tracking_numbers",
                    "description": "Tracking number array",
                    "type": "array",
                    "items": {
                      "name": "tracking_numbers",
                      "description": "Tracking number array",
                      "type": "string",
                      "example": ""
                    },
                    "example": [
                      ""
                    ]
                  },
                  "name": {
                    "name": "name",
                    "description": "Package",
                    "type": "string",
                    "example": "e.g. #1001.1, #1001.2"
                  },
                  "tracking_url": {
                    "name": "tracking_url",
                    "description": "Logistics tracking URL",
                    "type": "string",
                    "example": ""
                  },
                  "status": {
                    "name": "status",
                    "description": "Package tracking",
                    "type": "string",
                    "example": ""
                  },
                  "created_at": {
                    "name": "created_at",
                    "description": "Creation date",
                    "type": "string",
                    "example": ""
                  },
                  "tracking_urls": {
                    "name": "tracking_urls",
                    "description": "Logistics tracking URL group",
                    "type": "array",
                    "items": {
                      "name": "tracking_urls",
                      "description": "Logistics tracking URL group",
                      "type": "string",
                      "example": ""
                    },
                    "example": [
                      ""
                    ]
                  },
                  "order_id": {
                    "name": "order_id",
                    "description": "Order number",
                    "type": "string",
                    "example": ""
                  },
                  "id": {
                    "name": "id",
                    "description": "Package ID",
                    "type": "string",
                    "example": ""
                  },
                  "tracking_company": {
                    "name": "tracking_company",
                    "description": "Logistics company name",
                    "type": "string",
                    "example": ""
                  },
                  "line_items": {
                    "name": "line_items",
                    "description": "Item group",
                    "type": "array",
                    "items": {
                      "name": "line_items",
                      "description": "Item group",
                      "type": "object",
                      "properties": {
                        "requires_shipping": {
                          "name": "requires_shipping",
                          "description": "Shipping or not",
                          "type": "boolean",
                          "example": false
                        },
                        "taxable": {
                          "name": "taxable",
                          "description": "Tax or not？",
                          "type": "boolean",
                          "example": false
                        },
                        "tax_lines": {
                          "name": "tax_lines",
                          "description": "Tax",
                          "type": "array",
                          "items": {
                            "name": "tax_lines",
                            "description": "Tax",
                            "type": "object",
                            "properties": {
                              "rate": {
                                "name": "rate",
                                "description": "Tax rate",
                                "type": "string",
                                "example": ""
                              },
                              "title": {
                                "name": "title",
                                "description": "Tax name",
                                "type": "string",
                                "example": ""
                              },
                              "price": {
                                "name": "price",
                                "description": "Amount",
                                "type": "string",
                                "example": ""
                              },
                              "price_set": {
                                "name": "price_set",
                                "description": "Multi-currency amount",
                                "type": "object",
                                "properties": {
                                  "presentment_money": {
                                    "name": "presentment_money",
                                    "description": "Settlement currency",
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "name": "amount",
                                        "description": "Amount",
                                        "type": "string",
                                        "example": ""
                                      },
                                      "currency_code": {
                                        "name": "currency_code",
                                        "description": "Currency",
                                        "type": "string",
                                        "example": ""
                                      }
                                    },
                                    "example": {
                                      "currency_code": "",
                                      "amount": ""
                                    }
                                  },
                                  "shop_money": {
                                    "name": "shop_money",
                                    "description": "Store currency",
                                    "type": "object",
                                    "properties": {
                                      "currency_code": {
                                        "name": "currency_code",
                                        "description": "Currency",
                                        "type": "string",
                                        "example": ""
                                      },
                                      "amount": {
                                        "name": "amount",
                                        "description": "Amount",
                                        "type": "string",
                                        "example": ""
                                      }
                                    },
                                    "example": {
                                      "amount": "",
                                      "currency_code": ""
                                    }
                                  }
                                },
                                "example": {
                                  "shop_money": {
                                    "amount": "",
                                    "currency_code": ""
                                  },
                                  "presentment_money": {
                                    "amount": "",
                                    "currency_code": ""
                                  }
                                }
                              }
                            },
                            "example": {
                              "title": "",
                              "price": "",
                              "price_set": {
                                "presentment_money": {
                                  "currency_code": "",
                                  "amount": ""
                                },
                                "shop_money": {
                                  "currency_code": "",
                                  "amount": ""
                                }
                              },
                              "rate": ""
                            }
                          },
                          "example": [
                            {
                              "price": "",
                              "price_set": {
                                "presentment_money": {
                                  "amount": "",
                                  "currency_code": ""
                                },
                                "shop_money": {
                                  "currency_code": "",
                                  "amount": ""
                                }
                              },
                              "rate": "",
                              "title": ""
                            }
                          ]
                        },
                        "quantity": {
                          "name": "quantity",
                          "description": "Product quantity shipped",
                          "type": "integer",
                          "example": 0
                        },
                        "fulfillable_quantity": {
                          "name": "fulfillable_quantity",
                          "description": "Available quantity",
                          "type": "integer",
                          "example": 0
                        },
                        "sku": {
                          "name": "sku",
                          "description": "Product code",
                          "type": "string",
                          "example": ""
                        },
                        "grams": {
                          "name": "grams",
                          "description": "Weight",
                          "type": "double",
                          "example": 0
                        },
                        "title": {
                          "name": "title",
                          "description": "Product title",
                          "type": "string",
                          "example": ""
                        },
                        "price_set": {
                          "name": "price_set",
                          "description": "Multi-currency prices",
                          "type": "object",
                          "properties": {
                            "presentment_money": {
                              "name": "presentment_money",
                              "description": "Settlement currency",
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "name": "amount",
                                  "description": "Amount",
                                  "type": "string",
                                  "example": ""
                                },
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "Currency",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "amount": "",
                                "currency_code": ""
                              }
                            },
                            "shop_money": {
                              "name": "shop_money",
                              "description": "Store currency",
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "name": "amount",
                                  "description": "Amount",
                                  "type": "string",
                                  "example": ""
                                },
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "Currency",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "amount": "",
                                "currency_code": ""
                              }
                            }
                          },
                          "example": {
                            "shop_money": {
                              "amount": "",
                              "currency_code": ""
                            },
                            "presentment_money": {
                              "currency_code": "",
                              "amount": ""
                            }
                          }
                        },
                        "total_discount_set": {
                          "name": "total_discount_set",
                          "description": "Multi-currency discount",
                          "type": "object",
                          "properties": {
                            "shop_money": {
                              "name": "shop_money",
                              "description": "Store currency",
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "name": "amount",
                                  "description": "Amount",
                                  "type": "string",
                                  "example": ""
                                },
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "Currency",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "amount": "",
                                "currency_code": ""
                              }
                            },
                            "presentment_money": {
                              "name": "presentment_money",
                              "description": "Settlement currency",
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "name": "amount",
                                  "description": "Amount",
                                  "type": "string",
                                  "example": ""
                                },
                                "currency_code": {
                                  "name": "currency_code",
                                  "description": "Currency",
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "example": {
                                "amount": "",
                                "currency_code": ""
                              }
                            }
                          },
                          "example": {
                            "presentment_money": {
                              "amount": "",
                              "currency_code": ""
                            },
                            "shop_money": {
                              "currency_code": "",
                              "amount": ""
                            }
                          }
                        },
                        "version": {
                          "name": "version",
                          "description": "Product version",
                          "type": "string",
                          "example": ""
                        },
                        "variant_id": {
                          "name": "variant_id",
                          "description": "Product variant ID",
                          "type": "string",
                          "example": ""
                        },
                        "product_id": {
                          "name": "product_id",
                          "description": "Product ID",
                          "type": "string",
                          "example": ""
                        },
                        "fulfillment_quantity": {
                          "name": "fulfillment_quantity",
                          "description": "Shipping quantity",
                          "type": "integer",
                          "example": 1
                        },
                        "id": {
                          "name": "id",
                          "description": "Product ID",
                          "type": "string",
                          "example": ""
                        },
                        "total_discount": {
                          "name": "total_discount",
                          "description": "Discount amount",
                          "type": "string",
                          "example": ""
                        },
                        "name": {
                          "name": "name",
                          "description": "Product name",
                          "type": "string",
                          "example": ""
                        },
                        "price": {
                          "name": "price",
                          "description": "Price",
                          "type": "string",
                          "example": ""
                        },
                        "variant_title": {
                          "name": "variant_title",
                          "description": "Product variant name",
                          "type": "string",
                          "example": ""
                        }
                      },
                      "example": {
                        "fulfillable_quantity": 0,
                        "version": "",
                        "price_set": {
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "shop_money": {
                            "currency_code": "",
                            "amount": ""
                          }
                        },
                        "total_discount_set": {
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "shop_money": {
                            "amount": "",
                            "currency_code": ""
                          }
                        },
                        "name": "",
                        "title": "",
                        "id": "",
                        "price": "",
                        "taxable": false,
                        "total_discount": "",
                        "variant_title": "",
                        "requires_shipping": false,
                        "sku": "",
                        "product_id": "",
                        "fulfillment_quantity": 1,
                        "tax_lines": [
                          {
                            "price": "",
                            "price_set": {
                              "presentment_money": {
                                "amount": "",
                                "currency_code": ""
                              },
                              "shop_money": {
                                "amount": "",
                                "currency_code": ""
                              }
                            },
                            "rate": "",
                            "title": ""
                          }
                        ],
                        "grams": 0,
                        "variant_id": "",
                        "quantity": 0
                      }
                    },
                    "example": [
                      {
                        "fulfillable_quantity": 0,
                        "tax_lines": [
                          {
                            "title": "",
                            "price": "",
                            "price_set": {
                              "presentment_money": {
                                "amount": "",
                                "currency_code": ""
                              },
                              "shop_money": {
                                "currency_code": "",
                                "amount": ""
                              }
                            },
                            "rate": ""
                          }
                        ],
                        "taxable": false,
                        "grams": 0,
                        "title": "",
                        "id": "",
                        "version": "",
                        "price_set": {
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "shop_money": {
                            "currency_code": "",
                            "amount": ""
                          }
                        },
                        "variant_title": "",
                        "variant_id": "",
                        "total_discount": "",
                        "name": "",
                        "fulfillment_quantity": 1,
                        "quantity": 0,
                        "total_discount_set": {
                          "presentment_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "shop_money": {
                            "amount": "",
                            "currency_code": ""
                          }
                        },
                        "sku": "",
                        "requires_shipping": false,
                        "price": "",
                        "product_id": ""
                      }
                    ]
                  }
                },
                "example": {
                  "tracking_numbers": [
                    ""
                  ],
                  "tracking_url": "",
                  "line_items": [
                    {
                      "fulfillment_quantity": 1,
                      "variant_id": "",
                      "tax_lines": [
                        {
                          "price": "",
                          "price_set": {
                            "shop_money": {
                              "currency_code": "",
                              "amount": ""
                            },
                            "presentment_money": {
                              "currency_code": "",
                              "amount": ""
                            }
                          },
                          "rate": "",
                          "title": ""
                        }
                      ],
                      "grams": 0,
                      "total_discount_set": {
                        "presentment_money": {
                          "amount": "",
                          "currency_code": ""
                        },
                        "shop_money": {
                          "amount": "",
                          "currency_code": ""
                        }
                      },
                      "fulfillable_quantity": 0,
                      "name": "",
                      "quantity": 0,
                      "price_set": {
                        "presentment_money": {
                          "amount": "",
                          "currency_code": ""
                        },
                        "shop_money": {
                          "amount": "",
                          "currency_code": ""
                        }
                      },
                      "title": "",
                      "price": "",
                      "variant_title": "",
                      "sku": "",
                      "total_discount": "",
                      "taxable": false,
                      "requires_shipping": false,
                      "version": "",
                      "product_id": "",
                      "id": ""
                    }
                  ],
                  "tracking_urls": [
                    ""
                  ],
                  "updated_at": "",
                  "name": "e.g. #1001.1, #1001.2",
                  "status": "",
                  "id": "",
                  "tracking_number": "",
                  "created_at": "",
                  "order_id": "",
                  "tracking_company": ""
                }
              }
            },
            "example": {
              "fulfillment": {
                "line_items": [
                  {
                    "variant_id": "",
                    "requires_shipping": false,
                    "sku": "",
                    "tax_lines": [
                      {
                        "price": "",
                        "price_set": {
                          "shop_money": {
                            "amount": "",
                            "currency_code": ""
                          },
                          "presentment_money": {
                            "currency_code": "",
                            "amount": ""
                          }
                        },
                        "rate": "",
                        "title": ""
                      }
                    ],
                    "grams": 0,
                    "total_discount": "",
                    "title": "",
                    "product_id": "",
                    "taxable": false,
                    "total_discount_set": {
                      "presentment_money": {
                        "currency_code": "",
                        "amount": ""
                      },
                      "shop_money": {
                        "amount": "",
                        "currency_code": ""
                      }
                    },
                    "price": "",
                    "version": "",
                    "price_set": {
                      "presentment_money": {
                        "amount": "",
                        "currency_code": ""
                      },
                      "shop_money": {
                        "currency_code": "",
                        "amount": ""
                      }
                    },
                    "id": "",
                    "variant_title": "",
                    "fulfillment_quantity": 1,
                    "quantity": 0,
                    "fulfillable_quantity": 0,
                    "name": ""
                  }
                ],
                "status": "",
                "tracking_number": "",
                "updated_at": "",
                "order_id": "",
                "tracking_numbers": [
                  ""
                ],
                "tracking_urls": [
                  ""
                ],
                "tracking_company": "",
                "tracking_url": "",
                "created_at": "",
                "name": "e.g. #1001.1, #1001.2",
                "id": ""
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "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` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Cancel shipping",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_orders"
  ]
}
```