Update order item by ID

patch
/orders/{id}/items/{item_id}

Update an order item by ID.

id
string
required

The ID of the order.

item_id
string
required

The ID of the order item.

as-store-id
string
required

This value equals to store.id of Store Resource. You can obtain this id by making a GET /stores call to get existing stores or a POST /stores to create a new store.

product_id
string

The ID of the product in your system.

<= 128 characters
product_variant_id
string

The ID of the product variant in your system.

<= 128 characters
product_title
string

The title of the product.

<= 1024 characters
product_variant_title
string

The title of the product variant.

<= 1024 characters
sku
string

The SKU of the product variant.

<= 256 characters
quantity
integer

The quantity of the item ordered.

unit_price
Money

The unit price of the item.

Example:
{"currency":"USD","amount":"10"}
currency
string

Currency code for the amount, adhering to the ISO 4217 standard.

Allowed values:
AEDAFNALLAMDANGAOAARSAUDAWGAZNBAMBBDBDTBGNBHDBIFBMDBNDBOBBOVBRLBSDBTNBWPBYNBZDCADCDFCHECHFCHWCLFCLPCNYCOPCOUCRCCUCCUPCVECZKDJFDKKDOPDZDEGPERNETBEURFJDFKPGBPGELGHSGIPGMDGNFGTQGYDHKDHNLHRKHTGHUFIDRILSINRIQDIRRISKJMDJODJPYKESKGSKHRKMFKPWKRWKWDKYDKZTLAKLBPLKRLRDLSLLYDMADMDLMGAMKDMMKMNTMOPMRUMURMVRMWKMXNMXVMYRMZNNADNGNNIONOKNPRNZDOMRPABPENPGKPHPPKRPLNPYGQARRONRSDRUBRWFSARSBDSCRSDGSEKSGDSHPSLLSOSSRDSSPSTNSVCSYPSZLTHBTJSTMTTNDTOPTRYTTDTWDTZSUAHUGXUSDUSNUYIUYUUYWUZSVESVNDVUVWSTXAFXAUXBAXBBXBCXBDXCDXDRXOFXPDXPFXPTXSUXTSXUAXXXYERZARZMWZWL
Example:
USD
amount
string

The amount value in string format.

Example:
10
unit_weight
Weight

The unit weight of the item.

Example:
{"unit":"kg","value":10}
unit
string

The weight unit eg: g or kg.

Allowed values:
kglbozg
value
number

The value of the weight.

Example:
10
image_urls
array[string]

URLs of the product images.

discount
string

The total amount of the discount allocated to the line item. Including the discount applied only on this item and the allocated discount for the order level discount.

tax
string

The total amount of the tax allocated to the line item.

hs_code
string

Harmonized System (HS) Codes.

origin_country_region
string

The origin country of this product. The field should in ISO 3166-1 alpha-3 format.

product_tags
array[string]

Product tags of this variant.

product_categories
array[string]

Product categories of this variant.

returnable_quantity
integer

This field allows you to set the maximum returnable quantity for an order item when importing the order. When a shopper requests a return, they will not be able to select a quantity exceeding this specified limit.

meta
Meta

The Meta model holds the metadata of the API response, including relevant error details for debugging purposes.Show all...

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by AfterShip."}
code
number
required

Error code in integer format. For detailed information, please refer to the Request Error introduction page.

Default:
20000
Example:
20000
type
string
required

Response type string for the reference. For detailed information, please refer to the Request Error introduction page.

>= 1 characters
Example:
OK
message
string
required

Human-readable response message. For detailed information, please refer to the Request Error introduction page.

>= 1 characters
Example:
The request was successfully processed by AfterShip.
errors
array[Error]

Error detail object. Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.Show all...

data
OrderItem

The OrderItem model represents an individual product within an order. It includes details such as the product ID, quantity, price and so on. This model ensures accurate item-level tracking for every order placed.Show all...

Example:
{"id":"13097711141107","sku":"SKU001","quantity":1,"unit_weight":{"unit":"kg","value":10},"unit_price":{"currency":"USD","amount":"10"},"product_title":"Power Mobile Phone","product_variant_title":"Power Mobile Phone Pro","discount":"10","tax":"10","product_id":"8021450916083","product_variant_id":"43768285298931","hs_code":"554521","origin_country_region":"USA","image_urls":["https://www.example.com/product/phone/image.jpg"],"product_tags":["mobile-phone"],"product_categories":["mobile-phone"],"returnable_quantity":1}
id
string
required

A unique identifier for the line item within the order. This should be provided when creating an order.

Please note:

  1. This is NOT the product.id of the Product resource.
  2. This ID should be the same as fulfillment.*.line_items.id.
<= 32 characters
Example:
13097711141107
sku
string

The item's SKU (stock keeping unit).

<= 256 characters
Example:
SKU001
quantity
integer
required

The number of items that have been purchased.

Example:
1
unit_weight
Weight

The item's weight.

Example:
{"unit":"kg","value":10}
unit_price
Money

The price of the item excluding discounts and taxes. Please note that the item total price needs to meet the following formula:Show all...

Example:
{"currency":"USD","amount":"10"}
product_title
string
required

The title of the product.

Example:
Power Mobile Phone
product_variant_title
string

The title of the product variant.

<= 1024 characters
Example:
Power Mobile Phone Pro
discount
string

The total amount of the discount allocated to the line item. Including the discount applied only on this item and the allocated discount for the order level discount.

<= 100 characters
Example:
10
tax
string

The total amount of the tax allocated to the line item.

<= 100 characters
Example:
10
product_id
string

The ID of the product in your system.

Note that it should be the same as the product.id of the Product resource.

<= 128 characters
Example:
8021450916083
product_variant_id
string

The ID of the product variant in source system.

Note that it should be the same as the product.variants.id of the Product resource.

<= 32 characters
Example:
43768285298931
hs_code
string

Harmonized System (HS) Codes.

<= 256 characters
Example:
554521
origin_country_region
string

The origin country of this product. The field should in ISO 3166-1 alpha-3 format.

Example:
USA
Match pattern:
^[A-Z]{3}$
image_urls
array[string]

Image urls of this variant.

<= 100 items
product_tags
array[string]

Product tags of this variant.

product_categories
array[string]

Product categories of this variant.

returnable_quantity
integer

This field allows you to set the maximum returnable quantity for an order item when importing the order. When a shopper requests a return, they will not be able to select a quantity exceeding this specified limit.

Example:
1
Auth
:
Parameters
:
:
:
Body
{ "product_id": "string", "product_variant_id": "string", "product_title": "string", "product_variant_title": "string", "sku": "string", "quantity": 0, "unit_price": { "currency": "USD", "amount": "10" }, "unit_weight": { "unit": "kg", "value": 10 }, "image_urls": [ "string" ], "discount": "string", "tax": "string", "hs_code": "string", "origin_country_region": "string", "product_tags": [ "string" ], "product_categories": [ "string" ], "returnable_quantity": 0 }
Response Example
{ "meta": { "code": 20000, "type": "OK", "message": "The request was successfully processed by AfterShip." }, "data": { "id": "13097711141107", "sku": "SKU001", "quantity": 1, "unit_weight": { "unit": "kg", "value": 10 }, "unit_price": { "currency": "USD", "amount": "10" }, "product_title": "Power Mobile Phone", "product_variant_title": "Power Mobile Phone Pro", "discount": "10", "tax": "10", "product_id": "8021450916083", "product_variant_id": "43768285298931", "hs_code": "554521", "origin_country_region": "USA", "image_urls": [ "https://www.example.com/product/phone/image.jpg" ], "product_tags": [ "mobile-phone" ], "product_categories": [ "mobile-phone" ], "returnable_quantity": 1 } }