Get order by ID

get
/orders/{id}

Get an order by ID.

id
string
required

The ID of the order.

as-store-id
string
required

The unique store identifier is generated by AfterShip. You can obtain this id by making a GET /stores call to get existing stores or a POST /stores to create a new store.

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
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.Show all...

id
string

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.

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
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"]}
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"}
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"}
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...

pickup_info
Pickup

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

status_timestamps
StatusTimestamps

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

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...

Auth
:
Parameters
:
:
Response Example
{ "meta": { "code": 20000, "type": "OK", "message": "The request was successfully processed by AfterShip." }, "data": { "id": "0ecb8ff7efa84d7d8f763ed7b89851c8", "source_id": "5187092316403", "store": { "id": "0ecb8ff7efa84d7d8f763ed7b21851d1" }, "name": "#1086", "number": "1086", "currency": "HKD", "status": "open", "financial_status": "unpaid", "fulfillment_status": "unfulfilled", "order_total": "97", "shipping_total": "5", "tax_total": "10", "discount_total": "1", "subtotal": "90", "items": [ { "source_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", "fulfillable_quantity": 1, "source_product_id": "8021450916083", "source_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 } ], "note": "Created by AfterShip", "source_created_at": "2021-04-15T20:02:09Z", "source_updated_at": "2021-04-16T20:02:09Z", "created_at": "2021-04-15T20:02:09Z", "updated_at": "2021-04-16T20:02:09Z", "customer": { "source_id": "5127837778090", "first_name": "John", "last_name": "Doe", "emails": [ "[email protected]" ], "locale": "en-US", "phones": [ "+11234567890" ] }, "shipping_address": { "type": "business", "street_1": "1234 Elm Street", "street_2": "Apt 5", "street_3": "", "city": "New York", "state": "NY", "postal_code": "10001", "country_region": "USA", "company": "My Company", "first_name": "John", "last_name": "Doe", "email": "[email protected]", "phone": "+11234567890" }, "billing_address": { "type": "business", "street_1": "1234 Elm Street", "street_2": "Apt 5", "street_3": "", "city": "New York", "state": "NY", "postal_code": "10001", "country_region": "USA", "company": "My Company", "first_name": "John", "last_name": "Doe", "email": "[email protected]", "phone": "+11234567890" }, "tags": [ "mobile-phone" ], "shipping_method": "standard shipping", "delivery_method": "shipping", "pickup_location": { "location_id": "e9ec84ff351e45e089a7b75ae497e1ae", "address": { "type": "business", "street_1": "1234 Elm Street", "street_2": "Apt 5", "street_3": "", "city": "New York", "state": "NY", "postal_code": "10001", "country_region": "USA", "company": "My Company", "first_name": "John", "last_name": "Doe", "email": "[email protected]", "phone": "+11234567890", "coordinate": { "latitude": 43, "longitude": -75 } }, "opening_hours": { "sunday": { "open": true, "from": "10:30", "to": "20:30" }, "monday": { "open": true, "from": "10:30", "to": "20:30" }, "tuesday": { "open": true, "from": "10:30", "to": "20:30" }, "wednesday": { "open": true, "from": "10:30", "to": "20:30" }, "thursday": { "open": true, "from": "10:30", "to": "20:30" }, "friday": { "open": true, "from": "10:30", "to": "20:30" }, "saturday": { "open": true, "from": "10:30", "to": "20:30" } } }, "pickup_info": { "instructions": "Shop open from Mon to Fri", "estimated_ready_for_pickup_at": { "min": "2021-04-15T20:02:09Z", "max": "2021-04-15T20:02:09Z" }, "pickup_deadline_at": "2021-04-15T20:02:09Z" } } }