GoatLabels

Going Live With a Shipping API: Cutover Checklist

A step-by-step cutover from sandbox keys to live: wallet funding, webhooks, error handling, a small first batch, monitoring and a CSV rollback.

Get free rate quotes Free account. No card needed.

Going live with a shipping API means swapping a sandbox key for a live key, funding the wallet that pays for labels, and proving three things on real orders: retries never buy a label twice, webhooks are verified and acted on, and the team can fall back to CSV quickly. Start with a small first batch on a normal shipping day and widen only when the numbers reconcile. The numbered checklist below is the core of the cutover.

What changes when you move from sandbox keys to live keys?

Very little changes in the request, and a great deal changes in the consequences. On the GoatLabels v1 API, sandbox keys (sk_sandbox_) and live keys (sk_live_) use the same base URL, https://goatlabels.io/api/v1, and the same endpoints, so the only configuration change is the key. Every response carries a GoatLabels-Environment header that reads sandbox or live.

What the sandbox does not prove matters most. On the v1 API, a sandbox key runs the whole path against test data: rate quotes are the real prices, a purchase is paid from a test balance and returns a sample label, and return labels and pickups are simulated. No carrier is booked and nothing is charged. So the code paths that spend money have run, but never against your real wallet or a carrier, and the sandbox does not check your account's verification or the Free plan's monthly shipment allowance. Your first live purchase is a real, paid label, and by default a return label is paid when it is created. If the test layer is thin, the post on testing a shipping API in CI with test keys covers fixtures and webhook handler tests.

What belongs on the cutover checklist?

Give each line a named owner and a checked date.

  1. Create the live key on purpose. The account owner creates keys on the dashboard Developers page. The full key is shown once, so put it straight into your secret manager. Give reporting jobs a read-only key; it gets 403 insufficient_scope on any v1 API write.
  2. Keep sandbox and live keys apart. CI and staging never see the live key. Add a startup check that refuses to run unless the production key starts with sk_live_.
  3. Plan rotation. Rotating a key stops the old secret immediately, so create a second live key, deploy it, confirm its last-used date in the keys table, then revoke the old one.
  4. Fund the wallet for the first days of volume plus a cushion (worked example below).
  5. Derive idempotency keys from business data. Send an Idempotency-Key header, up to 255 characters, on create-shipment and purchase-label calls, built from values such as order number plus box number, never a timestamp.
  6. Drain retries before switching keys. Idempotency keys are scoped to the API key, so let in-flight retries finish before a worker changes keys.
  7. Honor rate limits. Read X-RateLimit-Remaining and X-RateLimit-Reset, and after a 429 wait the Retry-After seconds. The post on rate limits in batch integrations covers pacing.
  8. Register the production webhook endpoint on https and store its signing secret.
  9. Map your reference. Put your order or PO number in the shipment reference. It stays on the shipment and its ledger line, which is how finance matches spend to orders.
  10. Decide address rules. Choose what happens when the address check warns it could not verify a destination, and set each destination's Residential yes/no value from your data, since it feeds the quote.
  11. Build the monitoring listed in the first-batch section before the first live call.
  12. Rehearse the CSV fallback with a real export from your order system.
  13. Write the stop rule. Name who can halt the API worker and when, such as on any duplicate purchase or a disabled webhook endpoint.

If your client was generated from the spec, regenerate it from /api/v1/openapi.json before cutover and review the diff, as described in generating a shipping API client from OpenAPI.

How much money should be in the wallet at cutover?

Fund the wallet for several days of expected label spend plus a cushion, because each label debits the quoted amount from a prepaid wallet. Carrier adjustments after delivery, such as re-weighs and dimension corrections, post to the same wallet later.

Example: sizing a starting balance Value (example)
Orders per shipping day 240
Average quoted label price $12.00
Daily label spend $2,880
Days of cover before the next top-up 3
Label spend covered $8,640
Cushion for adjustments and returns $500
Starting balance $9,140

Replace these hypothetical numbers with your own order counts and the rate quotes a sandbox key returns, which are the real prices. The wallet is funded by card, so top it up before cutover day. Decide too what your code does when a purchase fails for lack of funds: stop the queue and alert, never retry in a loop.

To watch the balance, pull the ledger from the API. It returns rows newest first, cursor-paginated, up to 100 per page, each with type, amount, balance after, description and shipment id. Alert on the latest balance-after value well before the wallet runs dry.

How should live code handle errors and retries?

Live code should sort every failure into a few classes and handle each class the same way every time.

Failure What it means What to do
Timeout on a single purchase-label call The label may or may not have been bought Retry with the same Idempotency-Key; a replay returns the original response with Idempotent-Replayed: true
429, rate_limit_error Over 300 requests per minute on this API key Wait the Retry-After seconds, then retry with the same idempotency key
409, idempotency_error Idempotency key conflict, such as the same key with a different body Do not resend blindly; log the message and check key derivation
403, insufficient_scope A read-only key tried to write Fix the configuration
GoatLabels-Environment: sandbox on a production response A sandbox key reached production, and its labels are samples no carrier will accept Stop the worker and swap the key
Bad address, weight or dimensions The order data is wrong Send the order to a human queue

For batch work, size requests to the v1 API limits: up to 50 draft shipments per batch-create call and up to 10 labels per batch-purchase call. The Idempotency-Key header covers only the single create-shipment and purchase-label calls, so after a batch timeout, check what was bought before resending.

How do you confirm webhooks work in production?

You confirm webhooks by watching real deliveries arrive, verify and update orders during the first batch, and by alerting on failures early. On the v1 API, each delivery is signed with HMAC-SHA256 in the X-GoatLabels-Signature header, formatted t=<unix>,v1=<hex>, over the timestamp, a period and the raw body. Each endpoint has its own secret and must use https.

  • Answer within 5 seconds. A non-2xx response or no answer in 5 seconds is a failed delivery. Verify, store the event, return 2xx, and do the work on a queue.
  • Expect duplicates. Failed deliveries are retried at 30 seconds, 2 minutes and 10 minutes, and any delivery can arrive more than once. Make updates idempotent.
  • Alert long before 20 failures. An endpoint that fails 20 deliveries in a row is switched off, so page someone after a handful.

Every attempt is logged and can be replayed, so after fixing a bad deploy you can resend the events your handler missed.

What does a safe first batch and rollback look like?

A safe first batch is small, ordinary and fully reconciled before the next one starts. A cutover in the week of Monday, December 14, 2026 competes with holiday volume, so many teams hold integration changes until early January, for example Monday, January 4, 2027.

An example ramp, with hypothetical sizes:

  1. Day 1: 20 orders through the API, the rest through your current process. Check each one for a ledger line reading "Label purchase ", a tracking number in your system, and webhook events arriving.
  2. Day 2: 100 orders, only if day 1 reconciled with no duplicates.
  3. Day 3: full volume, with the CSV path still ready.

For the first two weeks, watch purchase success rate, 429 count, the lowest X-RateLimit-Remaining seen, consecutive webhook failures, balance after, and carrier adjustments. The API returns adjustments with original, adjusted and delta amounts; a growing delta usually means your order system sends wrong weights or dimensions.

If the stop rule fires, halt the API worker first. Then search shipments by reference to see what the API already bought, so those orders do not ship twice. Import the remaining orders through the bulk CSV label importer: up to 500 rows per file, each row checked separately, so one bad row does not fail the batch. A column named Order Number, Order ID, Order, Ref or Reference becomes the shipment reference. Last, cancel unused duplicate labels from the dashboard. The credit posts back to the wallet after the carrier confirms the label was not used; a scanned label cannot be cancelled.

Where GoatLabels fits

GoatLabels offers a REST API at https://goatlabels.io/api/v1 with Bearer key auth, live and sandbox keys on one base URL, Idempotency-Key on create-shipment and purchase-label calls, signed webhooks with retries and replay, and the wallet ledger through the API. The shipping API for developers page has the details, and it fits a B2B shipping software setup with CSV import as the fallback.

The limits matter on cutover day. A sandbox label is a sample that no carrier will accept, so the first label you can ship is the first one a live key buys. There is no SDK and no native ERP or WMS connector, so the integration is code your team owns. Support is email (contact@goatlabels.io) plus the in-app assistant, with no phone line, so put the escalation path in the runbook before the first live call.