# AfterShip setup for PopMCP

You paste one AfterShip organization API key (it starts with asat_). It works for every product you give it Read or Write access to, and an optional Environment field sends Shipping and Protection calls to AfterShip's sandbox.

- Auth: API credentials
- Setup time: 4 min
- API base URL: https://api.aftership.com
- Credentials screen: https://organization.automizely.com/api-keys
- Provider docs: https://www.aftership.com/docs/tracking/quickstart/authentication

## Approval required before this works

No one reviews you, but AfterShip sells API access per product: the Tracking API needs Tracking Premium or Enterprise, the Returns API needs Returns Premium or Enterprise, and the labels and rates APIs need Shipping Pro or Enterprise. AfterShip's help center says Tracking Essentials users cannot create API keys or use the Tracking API.

- Typical wait: None. A product answers as soon as its plan includes the API.
- Cost: From AfterShip's pricing pages: Tracking Premium starts at $59/month, Returns Premium at $99/month and Shipping Pro at $69/month. Enterprise tiers are custom.
- Blocked until approved: Each product separately. Without Tracking Premium the tracking tools fail; without Returns Premium the returns tools fail; without Shipping Pro rate quotes and label purchases fail. Products that are on an API plan keep working with the same key.
- Works meanwhile: Connect with the products your plans already cover. PopMCP records which products answered at connect time, and you can give the key access to the others once their plans include the API.

## Before you begin

- An AfterShip plan that includes the API for each product you want: Tracking API and webhooks come with Tracking Premium or Enterprise, the Returns API with Returns Premium or Enterprise, and the labels and rates APIs with Shipping Pro or Enterprise.
- An AfterShip member role that can view and edit API keys in your organization
- A short list of the products the AI should use (Tracking, Returns, Shipping, Protection, Parser, Commerce, Organization), because you grant Read or Write per product

## Get your credentials

### 1. Open API keys

Sign in to AfterShip and open Settings, API keys, or go straight to organization.automizely.com/api-keys. Keys made here belong to the whole organization and work across every AfterShip product.

Screen: https://organization.automizely.com/api-keys

### 2. Name the key and keep the signature header on API key

Click Create API key and enter a name such as `PopMCP`. For the signature header, keep API key. AES and RSA keys require every request to be signed, which PopMCP does not do, so they fail with 401.

Screen: https://organization.automizely.com/api-keys

### 3. Grant Read or Write per product, then save

Set each product the AI should use to Read or Write: Tracking, Returns, Shipping, Protection, Parser, Commerce and Organization. Read lets the AI look; Write also lets it create trackings, act on returns, buy labels or insure orders. Leave the rest without access, then click Save.

Screen: https://organization.automizely.com/api-keys

### 4. Copy the key

Copy the new key's value. It starts with `asat_`.

Screen: https://organization.automizely.com/api-keys

### 5. Paste the key into PopMCP

In PopMCP, paste the key into API key. Leave Environment (optional) blank for your live account, or type `sandbox` to send Shipping and Protection calls to AfterShip's test environment, where labels are free test labels and coverages are not charged. Click Connect AfterShip.

## Fields PopMCP asks for

- API key (apiKey) [required]: AfterShip → Settings → API keys (https://organization.automizely.com/api-keys) → Create an API key. Keep the signature header on "API key" and tick Read or Write for Tracking, Returns, Shipping, Protection, Parser, Commerce and Organization as needed. Sent as the as-api-key header; stored encrypted.
- Environment (optional) (environment): Leave blank for your live account. Enter "sandbox" to send Shipping and Protection calls to AfterShip's test environment (free test labels, no coverage charges). The same key works in both.

## Verify

PopMCP shows AfterShip as Verified (or `AfterShip (sandbox)`), and the connection profile lists which products the key could read at connect time. Asking the AI which parcels hit a delivery exception this week returns real trackings.

## Troubleshooting

### 401 `The API key is invalid.`

Cause: The key was copied incompletely or deleted, or its signature header is AES or RSA, which needs signed requests.

Fix: Create a key with the signature header set to API key, copy it in full, and reconnect.

### AfterShip accepted this key, but it can't read Tracking, Returns, Shipping, Commerce, Protection, Warranty or Organization data

Cause: Every product on the key is set to no access, or the organization has no plan that includes the API for those products.

Fix: Edit the key under Settings, API keys and give Read or Write to the products you use, then connect again.

### Some products answer 403 while others work

Cause: That product is set to no access on the key, or its plan does not include the API (for example Tracking Essentials).

Fix: Grant the product Read or Write on the key, or move that product to a plan with API access. The connection profile shows which products answered at connect time.

### Commerce tools ask which store to use

Cause: AfterShip needs the Commerce store in an as-store-id header, and your organization has more than one store.

Fix: Pick a store id from the list in the error, or ask the AI to run list_stores first. With a single store PopMCP fills it in.

### Labels made in sandbox are missing from the live account

Cause: Sandbox shipper accounts and labels are separate from live ones. Only Shipping and Protection use the sandbox; every other product stays live.

Fix: Reconnect with Environment left blank when you are ready to buy real labels.

### 429 TooManyRequests

Cause: Tracking limits each endpoint separately (listing trackings allows 6 requests a second, courier detection 3), and Shipping and Returns allow 10 requests a second per organization.

Fix: Slow down and retry. List trackings with filters such as tracking_numbers or a date range instead of paging through everything.

### Environment must be production or sandbox

Cause: The Environment field contains something other than those two values.

Fix: Leave it blank for your live account, or type sandbox.

---

Source: https://www.docs.popmcp.com/docs/integrations/aftership/