Go-live checklist
What to verify in sandbox before you request production access, and how to switch to live safely.
Work through this checklist in sandbox before you choose Request production access in the Partner Portal. Rehabify reviews your request against the same points.
Before you request production access
Keys and security
- API keys are loaded from environment variables or a secret manager, never hard-coded, and are never sent to browsers, mobile apps or URLs.
- Logs never contain API keys, webhook signing secrets,
Authorizationheaders orclinical.notes. Log theX-Request-Idresponse header instead. - You know how to rotate and revoke keys without downtime.
Creating referrals
- You capture the patient's consent before referring and send
consent.granted: true, ideally withmethod,captured_atandprivacy_notice_version. - Every
POST /partners/referralscarries anIdempotency-Key. You retry network errors,429,500and503with the same key, and use a new key when the body changes. - You send your own
partner_reference, and handle409 duplicate_partner_referenceby fetchingerror.existinginstead of creating a new referral. - You handle
422 validation_error(useparamto show which field is wrong) and422 consent_required. - You handle a rejected referral (test it with the magic number
+2348000000004, which returns422 patient_ineligible). - You store the referral's
idandtracking_code, and give the patientlinks.whatsapp_intake_url.
Reading data
- You can fetch a referral by
id,tracking_codeandpartner_reference. - List calls follow
next_cursoruntilhas_moreisfalse. - Your code treats every unknown or optional value as possibly
null.
Webhooks
- Your endpoint uses
https://, is publicly reachable, and answers2xxwithin 10 seconds. Slow work is done asynchronously. - You verify
X-Rehabify-Signatureagainst the raw body, with a 300-second tolerance and a constant-time comparison. - You deduplicate on the event
id, because delivery is at-least-once. - You use
data.sequence(orreferral.updated_at) to ignore stale or out-of-order events. - You handle all nine
referral.*event types andping, and ignore types you don't recognise. - You fetch patient details with
GET /partners/referrals/{id}when you need them. Webhooks never contain patient data.
Rate limits and errors
- You respect
Retry-Afteron429 rate_limit_exceededand back off with jitter. - You branch on
error.code, not onerror.message.
Scenarios to rehearse in sandbox
| Scenario | How |
|---|---|
| Full journey | Refer +2348000000003. Expect referral.created, referral.contacted, referral.provider_matched, referral.booked, referral.in_treatment and referral.completed. |
| Contacted only | Refer +2348000000001. |
| Matched and booked | Refer +2348000000002. |
| Rejected | Refer +2348000000004. Expect 422 patient_ineligible, and no referral is created. |
| Not suitable | Refer +2348000000005. |
| Cancelled | Refer +2348000000006. |
closed and other transitions | Refer any other number, then call POST /sandbox/referrals/{id}/advance. |
| Webhook retries | Return 500 from your endpoint, watch X-Rehabify-Delivery-Attempt increase, then return 200. |
| Duplicate delivery | Resend an event from the portal and confirm you process it only once. |
| Idempotent retry | Send the same POST twice with the same Idempotency-Key and confirm you get Idempotent-Replayed: true. |
Switching to live
Once Rehabify approves production access:
- Create a
sk_live_key in Developers → API keys. You can't create one before approval. - Set your live webhook endpoint in Developers → Webhooks, and store the live signing secret. It's different from the sandbox secret.
- Deploy the live key and secret to production. The base URL,
https://api.physioaroundme.com/v1, doesn't change. - Check that responses carry
X-Rehabify-Environment: live. - Remove any magic phone numbers or test data from your production flows. In live, Rehabify contacts every referred patient.
Keep your sandbox keys for staging and regression testing. Sandbox and live data never mix.
After go-live
- Watch for failed webhook deliveries in the portal, and resend them once your endpoint is healthy. Resent events keep the same event
id. - Reconcile commissions monthly with
GET /partners/commissions. - If production access is suspended, live calls return
403 production_access_required. Contact partners@physioaroundme.com.