Order

id
string
read-only

Unique identifier generated by AfterShip.

<= 32 characters
source_id
string
required

A unique identifier for the order.

<= 32 characters
name
string

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

<= 256 characters
number
string
required

The order number.

<= 64 characters
currency
string
required

The curreny of order.

status
string
required

The status of this order.

Allowed values:
openclosedcanceled
financial_status
string

The status of payments associated with the order.

Allowed values:
unpaidpartially_paidpaidpartially_refundedrefunded
fulfillment_status
string

The status of fulfillment associated with the order.

Allowed values:
unfulfilledpartially_fulfilledfulfilled
order_total
string
required

The total price of the order.

<= 100 characters
shipping_total
string

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

<= 100 characters
tax_total
string

The sum of all the taxes applied to the order.

<= 100 characters
discount_total
string

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

<= 100 characters
subtotal
string

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

<= 100 characters
items
array[OrderItem]

Items of order. Some fields of order item are defined as snapshot fields. These snapshot fields are related to product and can only be specified when creating an order.

<= 100 items
source_id
string
required

A unique identifier for the line item.

<= 32 characters
sku
string

Snapshot fieldThe item's SKU (stock keeping unit). Cannot be changed after creating in AfterShip.

<= 256 characters
quantity
integer
required

The number of items that have been purchased.

unit_weight
Weight
Example:
{"unit":"kg","value":10}
unit_price
string

Snapshot fieldThe price of the item before discounts and taxes have been applied. Cannot be changed after creating in AfterShip.
Please note that the item total price needs to meet the following formula:
item total price paid = unit_price*quantity - discount + tax

<= 100 characters
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
tax
string

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

<= 100 characters
fulfillable_quantity
integer

Total items available to fulfill.

source_product_id
string

Snapshot fieldThe ID of the product that the line item belongs to. It cannot be changed after creating in AfterShip.

<= 32 characters
source_variant_id
string

Snapshot fieldThe ID of the product variant. Default is the same value as source_product_id. Cannot be changed after creating in AfterShip.

<= 32 characters
title
string
required

The title of the product variant.

<= 1024 characters
hs_code
string

Harmonized System (HS) Codes.

<= 256 characters
origin_country_region
string

The origin country of this product.

<= 3 characters
image_urls
array[string]

Snapshot fieldImage urls of this variant. Cannot be changed after creating in AfterShip.

<= 100 items
product_categories
array[string]

Snapshot fieldProduct categories of this variant. Cannot be changed after creating in AfterShip.

product_tags
array[string]

Snapshot fieldProduct tags of this variant. Cannot be changed after creating in AfterShip.

shipments
array[Shipment]

order shipments.

<= 100 items
tracking_number
string

Tracking number.

<= 256 characters
slug
string

Unique code of the courier. Get couriers here: https://www.aftership.com/couriers.

<= 256 characters
additional_fields
object
items
array[object]

A list of line item objects, each containing information about an item in the shipment.

<= 100 items
source_id
string
required

The ID of shipment.

<= 32 characters
source_created_at
string

The date and time (ISO 8601 format) when shipment was created.

source_delivered_at
string

The date and time (ISO 8601 format) when shipment was delivered.

custom_fields
object

Custom fields that accept an object with string field.Show all...

note
string

An optional note that a shop owner can attach to the order.

<= 5000 characters
source_created_at
string

The date and time (ISO 8601 format) when an order was created.

source_updated_at
string

The date and time (ISO 8601 format) when an order was updated.

created_at
string

The date and time (ISO 8601 format) when an order was created in AfterShip.

updated_at
string

The date and time (ISO 8601 format) when an order was updated in AfterShip.

customer
Customer
Example:
{"source_id":"5127837778090","first_name":"teddy","last_name":"chan","emails":["[email protected]"],"locale":"en-US","phones":["+8613265883816"]}
source_id
string

A unique identifier for the customer.

<= 32 characters
first_name
string

The customer's first name.

<= 256 characters
last_name
string

The customer's last name.

<= 256 characters
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
shipping_address
Address
Example:
{"source_id":"1","description":"My Home Address","company":"aftership","first_name":"teddy","last_name":"chan","email":"[email protected]","address_line_1":"address2","address_line_2":"1233","address_line_3":null,"city":"HongKong","state":"HKG","country_region":"HKG","postal_code":"12323","phone":"+8613265883816","type":null,"tax_number":null}
description
string

The name or description of this address.

<= 256 characters
company
string

The company of the person associated with this address.

<= 256 characters
first_name
string

The customer’s first name.

<= 256 characters
last_name
string

The customer’s last name.

<= 256 characters
email
string

The unique email address of the customer.

<= 256 characters
address_line_1
string

The customer's mailing address.

<= 256 characters
address_line_2
string

An additional field for the customer's mailing address.

<= 256 characters
address_line_3
string

An additional field for the customer's mailing address.

<= 256 characters
city
string

The customer’s city, town, or village.

<= 256 characters
state
string

The customer’s region name. Typically a province, a state, or a prefecture.

<= 256 characters
country_region
string

The customer's country.

<= 3 characters
postal_code
string

The customer’s postal code, also known as zip, postcode, Eircode, etc.

<= 256 characters
phone
string

The customer’s phone number at this address.

<= 256 characters
type
string

The type of address (Eg: My home address, My office address).

Allowed values:
businessresidential
tax_number
string

Tax number for the address.

<= 256 characters
source_id
string

A unique identifier for the address.

<= 32 characters
billing_address
Address
Example:
{"source_id":"1","description":"My Home Address","company":"aftership","first_name":"teddy","last_name":"chan","email":"[email protected]","address_line_1":"address2","address_line_2":"1233","address_line_3":null,"city":"HongKong","state":"HKG","country_region":"HKG","postal_code":"12323","phone":"+8613265883816","type":null,"tax_number":null}
tags
array[string]

Tags attached to the order.

<= 100 items
shipping_method
string

The name of the shipping method.

<= 256 characters
Example
preparing...