What TeraRx sets up
TeraRx creates each brand at onboarding, with its plans, prices, retention and rule matrix, and gives you itstenant_id. You get:
Tokens: one brand at a time
Every token is for one brand. Name the brand withtenant_id when you ask for a token:
404 as if they did not exist.
tenant_not_permitted is the same answer for an unknown id and for another partner’s brand. Rate limits count per brand, so one busy brand does not slow the others.
Patient assertions
Sign every brand’s assertions with the same key and issuer, and add atenant_id claim naming the brand the patient is enrolled with:
sub is the external_patient_id you sent on POST /v1/enrollments for that brand. Your ids may repeat across brands; TeraRx looks sub up within the brand named by tenant_id. An assertion without tenant_id is refused with assertion_invalid, one naming a brand you may not act for with tenant_not_permitted. Everything else is as in Authentication.
Listing your brands
GET /v1/tenants (scope tenants:read) lists every brand under your partner, whichever brand the token is for, with its id, slug, display_name and whether it is live. Use it to check your configuration against ours. You need one brand’s tenant_id, from onboarding, to get the first token.
Webhooks
Events for all your brands go to your partner endpoint, signed with your secret, unless a brand has its own endpoint. Every event carriestenant_id: route on it. The payloads and signature are as in Webhooks.
Reports and invoices
GET /v1/reports/brand reports on the brand the token is for; ask once per brand. TeraRx sends one monthly invoice for all your brands, with a section per brand.
