# Empower Your Dev Team with the Shopee Express Tracking API via AfterShip

Integrate seamless Shopee Express tracking integration with robust RESTful API and webhooks to automate Shopee Express delivery updates in real-time.

With an AfterShip developer account, you'll experience fast tracking updates and industry-leading 99.9% API uptime. Enhance your logistics now with the Shopee Express Tracking API.

## Shopee Express Tracking API

### Create a tracking

Creates a new tracking object.

#### Parameters

- `tracking_number` string **required**  
  Tracking number of a shipment. Duplicated tracking numbers, tracking numbers with invalid tracking number format will not be accepted.
  
  Only accept tracking numbers with length from 4 to 100
- `slug` string, static `spx`.
- `title` string  
  By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g., the order number).
- `order_id` string  
  A globally-unique identifier for the order.
- `order_promised_delivery_date` string  
  The promised delivery date of the order. It uses the format `YYYY-MM-DD`. This has no timezone and uses whatever date you provide. Since other EDDs use the shipment recipient’s timezone, we suggest following the same logic here.

#### Returns

Return a tracking object if the call succeeded.

```bash
curl --request POST \
     --url https://api.aftership.com/tracking/2024-04/trackings \
     --header 'Content-Type: application/json'\
     --data '{"tracking":{"slug":"spx","title":"Title Name","smses":["+18555072509","+18555072501"],"emails":["email@yourdomain.com","another_email@yourdomain.com"],"order_id":"ID 1234","language":"en","pickup_note":"Reach out to our staffs when you arrive our stores for shipment pickup","origin_city":"Beijing","order_number":"1234","origin_state":"Beijing","order_id_path":"http://www.aftership.com/order_id=1234","custom_fields":{"product_name":"iPhone Case","product_price":"USD19.99"},"delivery_type":"pickup_at_store","tracking_number":"123456789","pickup_location":"Flagship Store","destination_city":"New York City","destination_state":"New York","origin_postal_code":"065001","origin_country_iso3":"CHN","origin_raw_location":"Lihong Gardon 4A 2301, Chaoyang District, Beijing, BJ, 065001, CHN, China","destination_postal_code":"10001","destination_country_iso3":"USA","destination_raw_location":"13th Street, New York, NY, 10011, USA, United States","order_promised_delivery_date":"2019-05-20"}}'
```

### Retrieve a tracking

Retrieves the details of an existing tracking. Supply the unique tracking ID from either a tracking creation request or the tracking list, and AfterShip will return the corresponding tracking information.

#### Parameters

- `fields` string  
  List of fields to include in the response. Use comma for multiple values. 
  Fields to include: `tracking_postal_code`, `tracking_ship_date`, `tracking_account_number`, `tracking_key`, `tracking_origin_country`, `tracking_destination_country`, `tracking_state`, `title`, `order_id`, `tag`, `checkpoints`
- `lang` string  
  Translate checkpoint messages from the carrier’s provided language to the target language.

#### Returns

Returns a tracking object if a valid identifier was provided.

```bash
curl --request GET \
     --url https://api.aftership.com/tracking/2024-04/trackings/id \
     --header 'Content-Type: application/json'
```

### Update a tracking

Updates the specific tracking by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

#### Parameters

- `smses` array[string]  
  The phone number(s) to receive sms notifications. Input [] to clear the value of this field. Supports up to 3 phone numbers.
- `emails` array[string]  
  Email address(es) to receive email notifications. Input [] to clear the value of this field. Supports up to 3 email addresses.
- `title` string  
  By default this field shows the tracking_number, but you can customize it as you wish with any info (e.g., the order number).
- `customer_name` string  
  Customer name of the tracking.
- `order_id` string  
  A globally-unique identifier for the order.
- `order_id_path` string  
  The URL for the order in your system or store.
- `note` string  
  Text field for the note. Input "" to clear the value of this field.
- `language` string  
  The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Use an ISO 639-1 Language Code to specify the language.
- `order_promised_delivery_date` string  
  The promised delivery date of the order. It uses the format YYYY-MM-DD. This has no timezone and uses whatever date you provide. Since other EDDs use the shipment recipient’s timezone, we suggest following the same logic here.

#### Returns

Returns the tracking object if the update succeeded.

```bash
curl --request PUT \
     --url https://api.aftership.com/tracking/2024-04/trackings/id \
     --header 'Content-Type: application/json'\
     --data '{"value":{"tracking":{"note":"some notes","title":"New Title"}}}'
```

### Delete a tracking

Delete a tracking.

#### Parameters

- `id` string **required**  
  Tracking ID

#### Returns

Returns a deleted object on success. Otherwise, this call raises an error.

```bash
curl --request DELETE \
     --url https://api.aftership.com/tracking/2024-04/trackings/id \
     --header 'Content-Type: application/json'
```

### Retrack an expired tracking

Retrack an expired tracking. Max 3 times per tracking.

#### Parameters

- `id` string, **required**  
  Tracking ID

#### Returns

Returns the tracking object if the retrack succeeded.

```bash
curl --request POST \
     --url https://api.aftership.com/tracking/2024-04/trackings/id/retrack \
     --header 'Content-Type: application/json'
```

### Mark tracking as completed

Mark a tracking as completed. The tracking won't auto-update until retrack it.

#### Parameters

`reason` string **required**  
required  
One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.

- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to Delivered and the subtag will be updated to `Delivered_001`.
- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.
- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`.

#### Returns

`meta` meta **required**

Meta data

- `code` integer **required**

meta code

Example: `200`
- `message` string

error message, only exist if the response status is not 2xx
- `type` string

error type, only exist if the response status is not 2xx

Allowed values: `BadRequest` `Unauthorized` `Forbidden` `NotFound` `TooManyRequests` `InternalError`

`data` object **required**
- `tracking` Tracking

Object describes the tracking information.

```bash
curl --request POST \
     --url https://api.aftership.com/tracking/2024-04/trackings/id/mark-as-completed \
     --header 'Content-Type: application/json'\
     --data '{"reason":{"type":"string","enum":["DELIVERED","LOST","RETURNED_TO_SENDER"],"description":"One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.

- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.
- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.
- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`."}}'
```

### Shopee Express Last Checkpoint API

#### Get last checkpoint

Return the tracking information of the last checkpoint of a single tracking.

#### Parameters

- `fields` string  
  List of fields to include in the response. Use comma for multiple values. Fields to include: `slug`, `created_at`, `checkpoint_time`, `city`, `coordinates`, `country_iso3`, `country_name`, `message`, `state`, `tag`, `zip`
- `lang` string  
  Support Chinese to English translation for `china-ems` and `china-post` only

#### Returns

- `meta` meta

- `data` object  
  - `id` string
  - `tracking_number` string
  - `slug` string spx
  - `tag` string
  - `subtag` string
  - `subtag_message` string
  - `checkpoint`Checkpoint

```bash
curl --request GET \
     --url https://api.aftership.com/tracking/2024-04/last_checkpoint/tracking_id \
     --header 'Content-Type: application/json'
```

### Batch predict the estimated delivery date

The estimated delivery date is provided by AfterShip, based on its AI-predictive model. You can display the EDD on the product page, cart, and order checkout page. It indicates when a customer will receive the order.

You can use AfterShip’s AI-powered predictive estimated delivery date API to provide expected delivery dates to shoppers for online orders without tracking numbers. You can get the earliest date, the latest date, and the most likely arrival date through our AI-predictive EDD API.

#### Parameters

- `estimated_delivery_dates` array[EstimatedDeliveryDate] **required**
- `slug` string `spx` **required**  
  AfterShip's unique code of courier. Please refer to [Download Link](https://track.aftership.com/couriers/download).
- `service_type_name` string or null
- `origin_address` object **required**
- `destination_address` object **required**
- `weight` object or null
- `package_count` integer or null
- `pickup_time` string or null
- `estimated_pickup` object or null  
  Either `pickup_time` or `estimated_pickup` is required.

#### Returns

- `meta` meta **required**
  - `code` integer **required**
  - `message` string
- `data` object **required**
- `estimated_delivery_dates` array[EstimatedDeliveryDate] **required**

```bash
curl --request POST \
     --url https://api.aftership.com/tracking/2024-04/estimated-delivery-date/predict-batch \
     --header 'Content-Type: application/json'\
     --data '{"estimated_delivery_dates":[{"slug":"spx","service_type_name":"{service_type_name}","origin_address":{"country":"USA","state":"WA","city":"Seattle","postal_code":"98108","raw_location":"Seattle, Washington, 98108, USA, United States"},"destination_address":{"country":"USA","state":"CA","postal_code":"92019","raw_location":"El Cajon, California, 92019, USA, United States"},"weight":{"unit":"kg","value":1},"package_count":1,"pickup_time":"2021-07-01 15:00:00"}]}'
```

## Why use AfterShip API for Shopee Express Integration

Integrating directly with Shopee Express's native API requires months of development, constant maintenance, and deep carrier-specific expertise. AfterShip offers a single unified RESTful API that supports Shopee Express and 1,200+ global carriers—while reducing development overhead, handling documentation changes, and managing regional exceptions. With AfterShip, you can focus on scaling operations rather than separate carrier technical challenges.
