Order

The Order model represents a customer's order object of your store. It includes details such as the order ID of your store, customer information, products, quantities, pricing, order status, and so on. This model is essential for managing and tracking orders through the API.

[url](../../docs/common_scenarios/tracking/bopis.md)

The Order model represents a customer's order object of your store. It includes details such as the order ID of your store, customer information, products, quantities, pricing, order status, and so on. This model is essential for managing and tracking orders through the API.Show all...

id
string
read-only

Unique identifier generated by AfterShip. Corresponds to fulfillment.order_id to link the order with its fulfillment details.

<= 32 characters
Example:
0ecb8ff7efa84d7d8f763ed7b89851c8
source_id
string
required

A unique identifier for the order in your system.

<= 32 characters
Example:
5187092316403
store
object

Indicate which store the order belongs to.

id
string
read-only

The store ID by AfterShip. Please refer to the store resource for the details.

Example:
0ecb8ff7efa84d7d8f763ed7b21851d1
name
string

The order name. Default is the same value as number.

<= 256 characters
Example:
#1086
number
string
required

The order number.

<= 64 characters
Example:
1086
currency
string
required

Specifies the currency for the order, adhering to the ISO 4217 Currency Codes standard.

Example:
HKD
Match pattern:
^[A-Z]{3}$
status
string
required

The status of the order.

Allowed values:
openclosedcanceled
Example:
open
financial_status
string or null

The status of payments associated with the order.

Allowed values:
unpaidpartially_paidpaidpartially_refundedrefunded
Example:
unpaid
fulfillment_status
string

The status of fulfillment associated with the order.

Allowed values:
unfulfilledpartially_fulfilledfulfilled
Example:
unfulfilled
order_total
string
required

The total price of the order.

<= 100 characters
Example:
97
shipping_total
string

The total shipping fee applied to the price of the order.

<= 100 characters
Example:
5
tax_total
string

The sum of all the taxes applied to the order.

<= 100 characters
Example:
10
discount_total
string

The total discounts applied to the order. The value should be equal to the sum of all item discounts.

<= 100 characters
Example:
1
subtotal
string

The price of the order after discounts but before shipping and taxes.

<= 100 characters
Example:
90
items
array[OrderItem]

Purchased items of the order.

<= 100 items
source_id
string
required

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

Please note:

  1. This is NOT the product.source_id of the Product resource.
  2. This source_id should be the same as fulfillments.*.line_items.source_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 before discounts and taxes have been applied.Show all...

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

The title of the product.

Example:
Power Mobile Phone
product_variant_title
string
required

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
fulfillable_quantity
integer

Total items available to fulfill.

Example:
1
source_product_id
string

The ID of the product in your system.

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

<= 32 characters
Example:
8021450916083
source_variant_id
string

The ID of the product variant in source system.

Note that it should be the same as the product.variants.source_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
note
string

A note that the shop owner can optionally attach to the order.

<= 5000 characters
Example:
Created by AfterShip
source_created_at
string

The date and time, formatted in ISO 8601, indicating when the order was created in your e-commerce system.

Example:
2021-04-15T20:02:09Z
source_updated_at
string

The date and time, formatted in ISO 8601, indicating when the order was updated in your e-commerce system.

Example:
2021-04-16T20:02:09Z
created_at
string

The date and time, formatted in ISO 8601, indicating when the order was created in AfterShip system.

Example:
2021-04-15T20:02:09Z
updated_at
string

The date and time, formatted in ISO 8601, indicating when the order was created in AfterShip system.

Example:
2021-04-16T20:02:09Z
customer
Customer

Customer information of the order.

Example:
{"source_id":"5127837778090","first_name":"John","last_name":"Doe","emails":["[email protected]"],"locale":"en-US","phones":["+13525554500"]}
source_id
string

A unique identifier for the customer of your store platform. It could be the customer ID of your system, or a URL friendly name or slug which is unique in your system.

<= 32 characters
Example:
5127837778090
first_name
string

The customer's first name.

<= 256 characters
Example:
John
last_name
string

The customer's last name.

<= 256 characters
Example:
Doe
emails
array[string]

The customer's email.

<= 100 items
phones
array[string]

The customer's phone number.

<= 100 items
locale
string

The language code of the customer, eg: en-US.

<= 128 characters
Example:
en-US
shipping_address
Address

Shipping address of the order.

Example:
{"type":"business","street_1":"1234 Elm Street","street_2":"Apt 5","street_3":null,"city":"New York","state":"NY","postal_code":"10001","country_region":"USA","company":"My Company","first_name":"John","last_name":"Doe","email":"[email protected]","phone":"+13525554500"}
type
string

The type of address.

Allowed values:
businessresidential
street_1
string
required

First line of the street address.

<= 256 characters
street_2
string or null

Second line of the street address.

<= 256 characters
street_3
string or null

Third line of the street address.

<= 256 characters
city
string

The location's city, town, or village.

<= 256 characters
state
string
required

The state or region of the location, such as a province, state, or prefecture.

<= 256 characters
postal_code
string

The postal code of the location (also known as zip code, postcode, Eircode, etc.).

<= 256 characters
country_region
string
required

The address country/region in ISO 3166-1 alpha-3 format. API will automatically convert input to uppercase.

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

The name of the company associated to the address.

<= 256 characters
first_name
string

The first name of the person associated to the address.

<= 256 characters
last_name
string

The last name of the person associated to the address.

<= 256 characters
email
string

The email address of the person associated to the address.

<= 256 characters
phone
string

The phone number of the person associated to the address.

<= 256 characters
billing_address
Address

Billing address of the order.

Example:
{"type":"business","street_1":"1234 Elm Street","street_2":"Apt 5","street_3":null,"city":"New York","state":"NY","postal_code":"10001","country_region":"USA","company":"My Company","first_name":"John","last_name":"Doe","email":"[email protected]","phone":"+13525554500"}
type
string

The type of address.

Allowed values:
businessresidential
street_1
string
required

First line of the street address.

<= 256 characters
street_2
string or null

Second line of the street address.

<= 256 characters
street_3
string or null

Third line of the street address.

<= 256 characters
city
string

The location's city, town, or village.

<= 256 characters
state
string
required

The state or region of the location, such as a province, state, or prefecture.

<= 256 characters
postal_code
string

The postal code of the location (also known as zip code, postcode, Eircode, etc.).

<= 256 characters
country_region
string
required

The address country/region in ISO 3166-1 alpha-3 format. API will automatically convert input to uppercase.

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

The name of the company associated to the address.

<= 256 characters
first_name
string

The first name of the person associated to the address.

<= 256 characters
last_name
string

The last name of the person associated to the address.

<= 256 characters
email
string

The email address of the person associated to the address.

<= 256 characters
phone
string

The phone number of the person associated to the address.

<= 256 characters
tags
array[string]

Tags attached to the order.

<= 100 items
shipping_method
string

The name of the shipping method.

<= 256 characters
Example:
standard shipping
delivery_method
required

Delivery method of the order.Show all...

Allowed values:
shippingpickup
Example:
shipping
pickup_location
PickupLocation

To indicate the pickup location of the order when the delivery method of the order is pickup.Show all...

location_id
string

The unique identifier for the address. You can find or create the corresponding value here.

Example:
e9ec84ff351e45e089a7b75ae497e1ae
address
AddressWithCoordinate

Address of the pickup location.

Example:
{"type":"business","street_1":"1234 Elm Street","street_2":"Apt 5","street_3":null,"city":"New York","state":"NY","postal_code":"10001","country_region":"USA","company":"My Company","first_name":"John","last_name":"Doe","email":"[email protected]","phone":"+13525554500","coordinate":{"latitude":43,"longitude":-75}}
opening_hours
OpeningHours

Opening hours information of the pickup location.

pickup_info
Pickup

To indicate the detailed pickup instruction of the order when the delivery method of the order is pickup.Show all...

instructions
string

Instructions for the pickup process.Show all...

Example:
Shop open from Mon to Fri
estimated_ready_for_pickup_at
object

The expected date and time when the items in this fulfillment order will be ready for pickup.Show all...

pickup_deadline_at
string<date-time>

The latest time by which the pickup must be completed, formatted in ISO 8601.Show all...

Example:
2021-04-15T20:02:09Z
status_timestamps
StatusTimestamps

This object tracks the timestamps for each status change.Show all...

opened_at
string<date-time> or null

Datetime when the status was set to open.

canceled_at
string<date-time> or null

Datetime when the status was set to canceld.

closed_at
string<date-time> or null

Datetime when the status was set to closed.

custom_fields
OrderCustomFields

Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any personal data in custom fields.Show all...

Example
preparing...