Skip to main content

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/v1 with a live_ credential. A sandbox credential sent to production is refused with a 401 naming 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, and GET /partner-api/v1/ says it in its body.

Credentials and tokens

  • Keep the client_secret in 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-Key with 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 the parent_event of 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) and 5xx. Back off exponentially, and on 429 wait at least the Retry-After seconds.
  • Don't retry a 400, 403, 404 or 422 unchanged: fix the request. Log the response body; its detail says 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 2xx within 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

  • GET /health/ needs no credentials and isn't rate limited: point your monitoring at it.
  • Follow the changelog (or its feed) for changes to the API.

Partner API v1. The API reference is generated from the API's own code.