Going live checklist
What to check before you point your integration at production. Each item is something that has cost integrations data or downtime.
Environment
- Switch the base URL and the credentials together:
https://api.dawatrack.com/partner-api/v1with alive_credential. A sandbox credential sent to production is refused with a401naming the sandbox's address. - Keep the sandbox for testing changes after you go live; your sandbox credentials keep working there.
- Check which environment answered: every response carries
X-DawaTrack-Environment, andGET /partner-api/v1/says it in its body.
Credentials and tokens
- Keep the
client_secretin a secret store, never in source code or a client-side app. It's shown once and stored hashed by us; if it leaks or is lost, ask us to revoke it and issue a new one. Revoking stops its tokens at once. - Cache the access token and reuse it until it expires (60 minutes). Requesting a new token for every call wastes your rate limit, and the token endpoint has its own, tighter one.
- On a
401, get a new token once and retry; if that fails too, stop and alert someone rather than looping.
Writes
- Send a fresh
Idempotency-Keywith every write that needs one, and the same key when you retry it. Store the key with the record in your system before you send, so a crash mid-request retries with it. See Idempotency. - Store each event's returned
id: it's theparent_eventof what comes next. See the parent rule. - Send batches of events with
POST /events/bulk/(up to 1,000) rather than many single calls, and poll its job for the result. - Check
GET /batches/{gtin}/{batch_number}/orphans/for the batches you write: an orphan is an event a recall can't reach.
Errors and retries
- Retry only what can succeed later: timeouts,
429,409(the same request still running) and5xx. Back off exponentially, and on429wait at least theRetry-Afterseconds. - Don't retry a
400,403,404or422unchanged: fix the request. Log the response body; itsdetailsays what was wrong. See Errors. - Watch
X-RateLimit-Limit. The default is 5000 requests a day per partner; ask us if your volume needs more. See Rate limits.
Webhooks
- Use an HTTPS endpoint, and verify every delivery's signature before acting on it. See Verifying webhooks.
- Answer with a
2xxwithin 10 seconds and do the work afterwards. A slow or failed answer is retried, up to 5 attempts. - Deduplicate on
X-Dawatrack-Event-Id: a retried delivery carries the same ID, and your handler may see it twice.
Recalls
- Run a recall drill on a real batch once your events are flowing, and check the reach matches what you shipped.
- Distributors and pharmacies: make sure your credential is linked to each facility it acts for, or recalls for it won't reach you.
Keep watching
Partner API v1. The API reference is generated from the API's own code.