API Quick Start

This quickstart guide intends to walk you through the common scenario to help you know how to use the AfterShip Commerce API.


Commerce API is a collection of eCommerce functionality exposed via API. It provides access to core capabilities that are commonly used in Stores, Products, Orders, and other eCommerce activities.

preparing...

All endpoints are only accessible via HTTPS.

If you want to quickly use the basic functions of Returns, please follow these steps:

1. Generate an API Key
2. Complete Returns Onboarding
3. Import Orders

preparing...

Once you have successfully imported the orders according to the above example, the following features of Returns can be used:

1. Accept return request in Returns Page
Customers can use their number/name + customer.emails on the Returns Page to find their order, then select return items, return reason, return resolution, shipping, and finally submit a return request.

2. Returns window - Order date
You can configure returns window based on source_created_at, and any return requests exceeding this window will be automatically blocked.

3. Blocklist - Customer
You can configure blocklist based on customer.emails to block return requests.

4. Allowlist - Order
You can configure allowlist based on name, making exceptions for specific orders so that customers can raise return requests.

5. Allowlist - Customer
You can configure allowlist based on customer.emails, making exceptions for specific customers so that they can raise return requests.

If you want to use more features of Returns, you can import order according to the following example:

preparing...

Once you have successfully imported the orders according to the above example, the following features of Returns can be used:

1. Returns window - Fulfillment date
You can configure returns window based on shipments[*].source_created_at, and any return requests exceeding this window will be automatically blocked.

2. Returns window - Delivery date
You can configure returns window based on shipments[*].source_delivered_at, and any return requests exceeding this window will be automatically blocked. If you are unable to provide the shipments[*].source_delivered_at, you can install our Tracking app and contact us to enable the configuration for you. Then, Returns can automatically retrieve the delivered date from Tracking.

3. Discounted items
You can enable Do not accept discounted items, and order with items[*].discount greater than 0 will be automatically blocked.

4. Blocklist - Product type
You can configure blocklist based on items[*].product_categories to block return requests.

5. Blocklist - Product tag
You can configure blocklist based on items[*].product_tags to block return requests.

6. Allowlist - Product type
You can configure allowlist based on items[*].product_categories, making exceptions for specific product types so that customers can raise return requests.

7. Allowlist - Product tag
You can configure allowlist based on items[*].product_tags, making exceptions for specific product tags so that customers can raise return requests.

8. Replace for another variant
You can provide Replace with the same item resolution to customer, but you need to import store and the corresponding products according to the following example:

If you want to quickly use the basic functions of Shipping, please follow these steps:

1. Generate an API Key
2. Complete Shipping Onboarding
3. Import Orders

preparing...

Once you have successfully imported the orders according to the above example, you can manage the imported orders and create labels in Shipping. Please note that some carriers may require additional fields to create labels, so if you find that imported orders can not create labels, please contact us for assistance.

If you want to quickly use the basic functions of Tracking, please follow these steps:

1. Generate an API Key
2. Complete Tracking Onboarding
3. Import Orders

preparing...

Once you have successfully imported the orders according to the above example, you can manage the imported shipments in Tracking.