Quickstart
From installation to your first request. The same key works for REST and MCP.
Install PackMate on Shopify
After approval in the App Store, click “Install”. PackMate runs on every plan, so you can start with Free.
Generate an API key
In the app under “Settings → AI access”. Keys start with pm_live_ or, for the sandbox, pm_test_.
Examplepm_live_4f3a8b9c2d1e...Make your first request
Use curl, fetch or any other HTTP client. The X-API-Key header authenticates every request.
curl https://api.packmate.shop/api/v1/health \ -H 'X-API-Key: pm_live_…'Next: connect MCP
The same key works for the MCP server. How to connect your AI app is described under “AI connection”.
Authentication with an API key
PackMate uses API keys with the X-API-Key header. Keys are stored SHA-256 hashed, are scoped to exactly one shop and can be rotated in one click.
| Topic | What applies | What it looks like |
|---|---|---|
| Key format | Two prefixes: pm_live_ for production, pm_test_ for the sandbox. 48 hex characters follow; the prefix is plaintext so you can recognise a key at a glance. | |
| Header format | Send the key in the X-API-Key header on every request. A Bearer token in the Authorization header is not accepted. | |
| Rotation | Generate a new key in the app, swap it in your client, then revoke the old one. PackMate allows up to 10 active keys per shop so the switch can be staged. | |
| Permissions (scopes) | Every key carries scopes. New keys: lesen (read) or lesen + schreiben (write); older keys may also carry irreversibel. When you create a key in the app, you choose its purpose; the scopes follow from it. Shopify staff permissions additionally limit who can generate keys. | |
Rate limits per plan
Limits per minute and for short spikes (burst). Spikes are smoothed by a token bucket, so short peaks are not blocked. Custom plans agree their own limits.
| Plan | Requests per minute | Short-term (burst) | Concurrent |
|---|---|---|---|
| Free | 60 | 120 | 5 |
| Basic | 120 | 240 | 10 |
| Pro | 300 | 600 | 25 |
| Business | 600 | 1200 | 50 |
| Custom | 2000 | agreed | agreed |
When you reach the limit you get a 429 response with a Retry-After header. The header tells you how many seconds to wait.
Error codes
Standard HTTP semantics with PackMate-specific error bodies. Every error contains a machine-readable code field and a readable message.
| Code | Side | Meaning | What you do |
|---|---|---|---|
| 400 | Client | Bad request — body or query is malformed | Check the request shape against the OpenAPI file. |
| 401 | Client | Unauthorized — missing or invalid API key | Send the X-API-Key header with a valid pm_live_ or pm_test_ key. |
| 402 | Client | Payment required — plan limit reached | Change plan or wait for the next billing cycle. Use “Reconcile orders” after the change. |
| 403 | Client | Forbidden — access denied | Check that the shop is enabled, the key has the required permission and whether an AI block applies (write requests from AI: KI_BESTAETIGUNG_FEHLT, “AI confirmation missing”). query_carrier_rates does not fetch live rates today. DHL labels can’t be created through the API (DHL_LABEL_API_GESPERRT; keys without the irreversibel scope get insufficient_scope before that); you create them in PackMate. |
| 404 | Client | Not found — resource doesn't exist | Verify the ID. For orders, the order may not yet be synced. |
| 422 | Client | Unprocessable — semantic validation failed | Read error.message — typically missing dimensions or invalid material. |
| 429 | Client | Too many requests — rate limit reached | Back off for as long as the Retry-After header says. See the “Rate limits per plan” table above. |
| 500 | Server | Internal error — bug on our side | Retry once, then email support@packmate.shop with the request_id from the error body. |
| 503 | Server | Service unavailable — maintenance or database issue | Retry with exponential backoff. |
Webhooks
PackMate registers Shopify webhooks: the GDPR-mandatory ones plus operational ones. Shopify signs all payloads with HMAC-SHA256; PackMate verifies the signature before processing.
| Topic | Kind | What PackMate does |
|---|---|---|
| customers/redact | Required | On a deletion request, PackMate replaces name and address on the orders’ shipping labels with “[redacted]”, removes the link to the label PDF and deletes the stored email from earlier data requests. Pack calculations contain no customer data and stay unchanged. |
| customers/data_request | Required | A customer requested a data export. PackMate compiles the export within 30 days. |
| shop/redact | Required | Shopify sends this about 48 hours after uninstall. PackMate then deletes all data of the shop from its database. |
| app/uninstalled | Required | The app was uninstalled. PackMate marks the shop as uninstalled, revokes its API keys and ends the subscription. The data is deleted with shop/redact. |
| products/update | Optional | A product changed — PackMate refreshes cached dimensions and metafields. |
| app/scopes_update | Optional | Required scopes changed — PackMate logs the change. |
Shopify signs all webhooks with HMAC-SHA256. PackMate verifies the signature before processing.
Ready? Generate an API key in the app under “Settings → AI access”. The same key works for REST and MCP.