AfterShip

App · E-Commerce · 4 actions

Connect your AfterShip account to detect couriers, create shipment trackings, and check delivery status.

Actions

ActionWhat it does
Create trackingStart tracking a shipment.
Detect courierIdentify the likely courier(s) for a tracking number.
Get trackingLook up a shipment's current status and checkpoint history.
List trackingsList the shipments tracked in your AfterShip account, optionally only those with certain statuses (such as Exception or Failed attempt) or updated recently.

Create tracking

Start tracking a shipment.

Inputs

Tracking numbertracking_numbertextRequired
Tracking number issued by the courier.
SlugslugtextRequired
Courier slug, for example 'ups' or 'fedex'. Use detect_courier to find it.
Titletitletext
Optional title for the tracking, for example an order number.
Order IDorder_idtext
Optional order ID to associate with the tracking.

Outputs

idtext
AfterShip tracking ID. Use with get_tracking.
tagtext
Initial tracking status, for example 'Pending'
Example output
{
  "id": "5b7f1a2e4c3d2a0011f5f2a1",
  "tag": "Pending"
}

Detect courier

Identify the likely courier(s) for a tracking number.

Inputs

Tracking numbertracking_numbertextRequired
Tracking number to identify the courier for.

Outputs

courierslist
Couriers that could match the tracking number
Example output
{
  "couriers": [
    {
      "name": "UPS",
      "slug": "ups"
    }
  ]
}

Get tracking

Look up a shipment's current status and checkpoint history.

Inputs

Tracking IDtracking_idtextRequired
The tracking's AfterShip ID (not the courier tracking number) -- returned as 'id' by create_tracking and list_trackings.

Outputs

checkpointslist
Tracking event history, oldest first
couriertext
Beta. The courier's name, such as UPS.
customer_emailtext
Beta. The customer's email address, blank when the shipment has none.
customer_first_nametext
Beta. The first word of the customer's name, to greet them by; blank when the shipment has no name.
customer_nametext
Beta. The customer's name, blank when the shipment has none.
expected_deliverytext
Latest estimated delivery date/time, if known
idtext
AfterShip tracking ID
latest_updatetext
Beta. The courier's latest tracking update, such as 'Delivery attempted - no one home'.
order_numbertext
Beta. The order number the shipment belongs to, blank when none was saved.
slugtext
Courier slug
statustext
Beta. The shipment's status in plain words: Pending, Info received, In transit, Out for delivery, Failed attempt, Available for pickup, Exception, Expired or Delivered.
status_detailtext
Beta. AfterShip's one-line reason for the status, such as 'Customer moved'.
tagtext
Current status, for example 'InTransit' or 'Delivered'
tracking_linktext
Beta. A link the customer can open to follow the shipment.
tracking_numbertext
Tracking number
updated_attext
Beta. When the shipment last changed in AfterShip.
updated_displaytext
Beta. When the shipment last changed, written out, such as Nov 3, 2026.
Example output
{
  "checkpoints": [
    {
      "checkpoint_time": "2026-01-28T10:00:00Z",
      "location": "Louisville, KY",
      "message": "Departed from facility",
      "tag": "InTransit"
    }
  ],
  "courier": "UPS",
  "customer_email": "jamie@example.com",
  "customer_first_name": "Jamie",
  "customer_name": "Jamie Rivera",
  "expected_delivery": "2026-02-01T10:00:00-05:00",
  "id": "5b7f1a2e4c3d2a0011f5f2a1",
  "latest_update": "Departed from facility",
  "order_number": "#1042",
  "slug": "ups",
  "status": "In transit",
  "status_detail": "Shipment on the way",
  "tag": "InTransit",
  "tracking_link": "https://yourshop.aftership.com/1Z999AA10123456784",
  "tracking_number": "1Z999AA10123456784",
  "updated_at": "2026-11-03T09:12:00+00:00",
  "updated_display": "Nov 3, 2026"
}

List trackings

List the shipments tracked in your AfterShip account, optionally only those with certain statuses (such as Exception or Failed attempt) or updated recently. Each one comes with the customer's name and email, the order number, the status in plain words and a tracking link, ready for an email or a support ticket.

Inputs

Only these statusesstatuseslist
Beta. Only list shipments in any of these statuses. Leave empty for every status.One or more of: Pending, InfoReceived (Info received), InTransit (In transit), OutForDelivery (Out for delivery), AttemptFail (Failed attempt), AvailableForPickup (Available for pickup), Exception, Expired, Delivered.
Updated in the last (hours)updated_within_hoursnumber
Beta. Only list shipments that changed in this many hours, such as 24 for the last day. Leave empty for any time. A change is any courier update, so a shipment that stays in Exception is listed again each day a scan comes in: to act once when a shipment reaches a status, use the Shipment status changed trigger instead.From 1 to 2160.

Outputs

countnumber
Beta. How many shipments were listed.
trackingslist
The matching shipments, up to 2,000 (AfterShip's first ten pages).
Example output
{
  "count": 1,
  "trackings": [
    {
      "courier": "UPS",
      "customer_email": "jamie@example.com",
      "customer_first_name": "Jamie",
      "customer_name": "Jamie Rivera",
      "id": "5b7f1a2e4c3d2a0011f5f2a1",
      "latest_update": "Delivery attempted - no one home",
      "order_number": "#1042",
      "slug": "ups",
      "status": "Failed attempt",
      "status_detail": "Customer not available at the address",
      "tag": "AttemptFail",
      "tracking_link": "https://yourshop.aftership.com/1Z999AA10123456784",
      "tracking_number": "1Z999AA10123456784",
      "updated_at": "2026-11-03T09:12:00+00:00",
      "updated_display": "Nov 3, 2026"
    }
  ]
}

On this page