Prepare an API integration for production
Use this checklist after a workflow works against preview and before it handles production orders, shipments, or tracking events.
Separate preview and production
| Product | Preview | Production |
|---|---|---|
| Hub API | https://api-test.orderly-hub.com/api/v1 | https://api.orderly-hub.com/api/v1 |
| Intelligence | https://api-staging.orderlycore.com/v1 | https://api.orderlycore.com/v1 |
Keep base URLs, credentials, and organization IDs in environment-specific configuration. Do not infer production values from preview or reuse preview keys.
Harden authentication
- Create a dedicated API key for the integration.
- Grant only the scopes required by its current endpoints.
- Store the key in a secrets manager, never in source control or browser code.
- Record the owner and expiry date.
- Define rotation before the first emergency requires it.
- Revoke preview and test keys that are no longer used.
Always send X-Organization-Id when the endpoint is organization-scoped. Treat
the organization ID as configuration, not user input.
Set safe request behavior
- Use explicit connection and response timeouts.
- Retry
429and transient5xxresponses with exponential backoff and jitter. - Respect
Retry-Afterwhen it is present. - Do not automatically retry a write unless the endpoint and your workflow make the operation safe to repeat.
- Put a maximum attempt count and total retry window on every retry policy.
- Validate response envelopes before reading data.
Hub list endpoints use a { data, pagination } shape. Intelligence responses
use { ok, data, meta } and include a request ID in meta.
Handle pagination and volume
Never assume the first page is the complete dataset.
- Set an intentional page size.
- Follow pagination until the expected end condition.
- Process pages incrementally rather than holding an unbounded result in memory.
- Store a checkpoint for long-running synchronization.
- Use source timestamps or supported filters for incremental reads.
Test with production-like volume in preview, including empty pages and records that change during the sync.
Make webhooks resilient
- Expose a public HTTPS endpoint.
- Verify the signature before trusting the payload.
- Preserve the raw body required by signature verification.
- Return
2xxquickly, then process asynchronously. - Deduplicate repeated deliveries.
- Make handlers safe when events arrive late or out of order.
- Log the event type, organization, entity ID, and processing result.
- Keep a replay or recovery path when downstream processing fails.
Webhook delivery retries do not replace your own dead-letter and recovery strategy.
Log for support and recovery
For every API call, record:
- product and endpoint,
- organization ID,
- response status,
- request ID,
- attempt number and duration,
- safe entity identifiers,
- final outcome.
Never log API keys, bearer tokens, carrier credentials, webhook secrets, or unnecessary customer data.
Monitor the business outcome
Technical success is not enough. Alert when:
- order or tracking volume unexpectedly drops,
- a sync checkpoint stops advancing,
- webhook failures increase,
401,403,429, or5xxresponses cross a threshold,- Intelligence feed lag or unknown-code rate rises,
- a write workflow creates duplicates or partial results.
Connect operational alerts to an owner and a documented response.
Rehearse failure
Before launch, test:
- expired or revoked credentials,
- wrong organization ID,
- API timeout,
- rate limiting,
- temporary
5xx, - duplicate webhook delivery,
- out-of-order events,
- partial downstream failure,
- rollback or replay.
Use Troubleshoot Orderly as the starting runbook, then add integration-specific commands and ownership.
Launch checklist
- Preview and production configuration are separate.
- Least-privilege production credentials are stored securely.
- Timeouts, bounded retries, and pagination are implemented.
- Write retries and webhook delivery are safe to repeat.
- Logs include request IDs without secrets.
- Technical and business-volume alerts have owners.
- Failure and rollback procedures were rehearsed.
- The first production run has a narrow scope and active monitoring.