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.
1. What is 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.
2. API Endpoint
All endpoints are only accessible via HTTPS
.
3. Generate an API Key
AfterShip verifies a user's request by adding an as-api-key
in the header.
To get your API key, visit API key, click Create an API key and follow the given instructions to generate your API key.
Please visit here for the API authentication detail.
4. Create a Store
In the Commerce API, a store
represents your actual retail outlet or an online store. All other resources within the API, including orders and products, are linked to a specific store.
Therefore, before you can utilize any features of the Commerce API, you must first create a store. After the store has been created, you will obtain a store ID. This ID is crucial as it must be included in the header of all subsequent API requests as as-store-id
, allowing the system to identify which store context your operations should apply to.
Activating the store
After creating your store in Commerce API, please contact our support team or your customer success manager to configure and enable the specific Commerce API features you need (such as tracking
, returns
, etc.) for this store. This is a separate configuration from any AfterShip products you may have already subscribed to. When reaching out, provide the store.id
you received in the previous step.
5. Common Scenarios
You can utilize the Commerce API in various ways, depending on your specific usage scenarios. Please visit the links below for quick-start tutorials tailored to different use cases:
Tracking
- Introduction
- Sending Notifications
- Estimated Delivery Date
- Branded Tracking Page
- Product Recommendation
- Buy Online, Pickup In Store (BOPIS)
- Next couriers
- Other Scenarios