canonical: https://jentic.com/apis/aftership.com/aftership

# AfterShip Shipping API

Jentic publishes the only available OpenAPI specification for AfterShip Shipping API, keeping it validated and agent-ready. AfterShip Shipping (formerly Postmen) consolidates dozens of carrier APIs - UPS, FedEx, USPS, DHL, and many regional couriers - behind a single multi-carrier interface. The API covers the full outbound shipping lifecycle: comparing rates across couriers, generating labels, building manifests, listing courier accounts, and cancelling labels before pickup.

## For AI agents

Compare carrier rates, generate shipping labels, build manifests, and cancel labels across UPS, FedEx, USPS, DHL, and regional couriers through one unified API.

## Scope

Does not handle post-shipment tracking events, returns portals, or warehouse inventory - use for outbound rates, labels, manifests, and cancellations only (use AfterShip Tracking for delivery events).

## Capabilities

- Compare shipping rates across multiple couriers for a single shipment
- Generate a shipping label by selecting a quoted rate from a carrier
- Cancel a generated label before the shipment is picked up
- Build manifests so couriers can pick up the day's shipments
- List configured courier accounts attached to the AfterShip workspace
- Validate addresses against couriers before quoting rates
- Manage carrier-specific options like signature required and Saturday delivery

## Use cases

### Multi-Carrier Rate Shopping

E-commerce platforms call POST /rates with origin, destination, and parcel details to receive a list of carrier rates ranked by price and transit time. The shopper or merchant picks the best rate and the platform generates a label by referencing the chosen rateId. This avoids the per-carrier integration cost - one API call returns UPS, FedEx, USPS, and DHL options.

Example prompt: Call POST /rates with a 2kg parcel from 10001 New York to 90001 Los Angeles and return the top three carrier options sorted by total cost

### Automated Label Generation

Order management systems generate shipping labels at fulfilment time by calling POST /labels with the chosen rateId from the rate-shop step. The response includes a printable PDF or PNG label plus the tracking number, which is written back to the order record. Replaces per-carrier label SDK integrations and works across UPS, FedEx, USPS, DHL, and regional couriers.

Example prompt: After picking the cheapest UPS rate from POST /rates, call POST /labels and save the returned label PDF and tracking number to the order

### End-of-Day Manifest Creation

Warehouses call POST /manifests at the end of the picking shift so each courier has a single document listing all packages to collect. The manifest groups labels generated that day into a SCAN form (UPS), end-of-day manifest (FedEx), or equivalent. Cancellations before manifest creation use POST /cancel-labels to keep the document clean.

Example prompt: Build today's manifest for the UPS courier account, then cancel any labels in error status from the same day

### AI Agent Fulfilment Operations

Through Jentic, an agent can run shipping operations end-to-end - quote, label, manifest - without holding the AfterShip API key. The agent searches for the operation, loads the schema, and Jentic injects the as-api-key header at execution time, returning a structured response.

Example prompt: Search Jentic for 'generate shipping label aftership', load the POST /labels schema, and execute it for an order with the chosen UPS rateId

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /rates | Compare rates across multiple couriers |
| GET | /rates/{rateId} | Retrieve a specific rate quote |
| POST | /labels | Generate a shipping label from a quoted rate |
| GET | /labels/{labelId} | Retrieve a generated label |
| POST | /manifests | Create a manifest for a courier |
| GET | /couriers | List configured courier accounts |
| POST | /cancel-labels | Cancel one or more generated labels |

## Key resources

- **Rates** — Multi-carrier rate shopping for outbound shipments
- **Labels** — Generate, retrieve, and cancel shipping labels
- **Manifests** — End-of-day manifests per courier account
- **Couriers** — Configured courier accounts and capabilities

## Why Jentic

- **Setup:** Wiring the AfterShip Shipping API by hand means managing its as-api-key header and coding your own logic across rates, labels, and manifests, where label generation incurs real shipping costs. Through Jentic you install once, import the AfterShip Shipping API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** AfterShip puts the rate and label ids in the URL path for reads (/labels/{labelId}), so a rule can pin the agent to reading a specific label, while creation takes its input in the body. You choose which operations it may call, such as comparing rates, so label creation or cancellation is not included unless you add it.
- **Credential handling:** Your AfterShip API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'compare shipping rates', and Jentic returns the matching AfterShip Shipping operation with its schema so the agent calls rates or labels without browsing the reference docs.

## Related APIs

- **Shippo API** — SMB-friendly multi-carrier shipping API with similar rate-shop and label flows.
- **ShipStation API** — Order-oriented multi-carrier shipping API focused on warehouse fulfilment workflows.
- **Easyship API** — Multi-carrier shipping platform with strong cross-border tax and duties support.
- **Shopify Admin API** — Storefront platform that often hosts the orders being shipped.

## FAQ

### Why is there no official OpenAPI spec for AfterShip Shipping API?

AfterShip does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call AfterShip Shipping API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the AfterShip Shipping API use?

AfterShip Shipping uses an API key sent in the as-api-key request header. Through Jentic, that header is populated at execution time from the encrypted vault, so the agent never holds the raw key.

### Can I generate a UPS or FedEx label with the AfterShip Shipping API?

Yes. POST /rates returns rate options across all configured couriers (UPS, FedEx, USPS, DHL, and regional partners), then POST /labels generates the label for the chosen rateId. AfterShip handles the per-carrier API calls under the hood.

### What are the rate limits for the AfterShip Shipping API?

The spec does not list explicit rate limits, but AfterShip enforces per-plan limits on calls per minute. Most fulfilment integrations stay well under the limit; back off on HTTP 429 if you hit it during peak periods like Black Friday.

### How do I generate a label through Jentic?

Search Jentic for 'generate aftership shipping label', load the POST /labels schema, and execute with the chosen rateId from a prior /rates call. Jentic returns the label PDF URL and tracking number to the agent.

### Is the AfterShip Shipping API the same as AfterShip Tracking?

No. This API (formerly Postmen) handles outbound shipping - rates, labels, manifests. AfterShip Tracking is a separate product covering post-shipment delivery events. Use this API to get a parcel out the door, not to track it after pickup.

### Can I limit what my agent is allowed to do with the AfterShip Shipping API?

Yes. Because Jentic One is self-hosted, you write the rules that decide which AfterShip operations and credentials your agent may use. You can allow read-only work, such as comparing rates with POST /rates or retrieving a specific label with GET /labels/{labelId}, while withholding operations that create real shipping cost, so POST /labels and POST /cancel-labels are not callable unless you add them. Since label and rate ids sit in the URL path for reads, a rule can even pin the agent to a specific label rather than the whole account.
