Authentication
Create a key in Settings → API & webhooks. It is shown once. Send it as a bearer token:
curl https://portal.medgroupglobal.com/api/v1/orders \ -H "Authorization: Bearer pnk_live_…"
Keys are read-only: every write (POST, PUT, PATCH, DELETE) answers 403, and a key never reaches the admin area whatever the owner's role. Up to 300 requests a minute per key; over that, 429. Revoking a key takes effect at once.
Conventions
JSON everywhere. Times are ISO-8601 UTC. Money is {amountMinor, currency}-style: integer minor units next to the currency (totalMinor, usdMinor). Percentages are basis points (1250 = 12.5 %). Errors always look like:
{ "error": { "code": "unauthorized", "message": "Please sign in.", "field": null } }The machine-readable description is at /api/v1/openapi.json (OpenAPI 3.1).
Endpoints
| GET /api/v1/me | The account the key belongs to. |
| GET /api/v1/application | Your application: status, plan, approved brands, document metadata, terms per brand. |
| GET /api/v1/orders?kind=&site=&limit= | Orders and quotes across our shops (the newest 100 per shop). Numbers carry the site code. |
| GET /api/v1/scorecard | Paid orders, last 365 days against the 365 before, per brand. |
| GET /api/v1/prices | Brands you can download a partner price list for. |
| GET /api/v1/prices/{brand} | List and partner price per product on that brand, in the shop currency. |
| GET /api/v1/deals | Your deal registrations and their protection dates. |
| GET /api/v1/leads | Enquiries matched to your brands and country (no contact details). |
| GET /api/v1/announcements | The announcement board. |
| GET /api/v1/rebates | The running rebate period, your tiers, and every statement. |
Webhooks
Register an https:// endpoint on a public host and pick the events. We POST each one as JSON and expect a 2xx within ten seconds. Anything else is retried after 1 min, 5 min, 30 min, 2 h, 12 h and 24 h, then given up; twenty failures in a row switch the endpoint off until you turn it back on. “Send test” posts a ping right away.
POST https://example.com/portal-webhook
Content-Type: application/json
X-Portal-Event: order.updated
X-Portal-Delivery: 7a1f… # unique per delivery; retries reuse it
X-Portal-Timestamp: 1762150000 # unix seconds
X-Portal-Signature: v1=3f9c… # hex HMAC-SHA256(secret, timestamp + "." + body)
{ "id": "7a1f…", "event": "order.updated", "createdAt": "2026-11-03T08:00:00.000Z",
"account": { "id": "…" },
"data": { "orderId": "…", "site": "medicaldevicelab.com", "remoteId": "…", "kind": "ORDER", "number": "MED-O-2026-23762", "status": "SHIPPED", "new": false } }Payloads carry ids and states, not documents or customer details — read the rest through the API with a key. Verify the signature before trusting a delivery, and ignore timestamps older than five minutes:
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verify(secret, headers, rawBody) {
const ts = headers['x-portal-timestamp'];
const given = headers['x-portal-signature']; // "v1=…"
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const want = 'v1=' + createHmac('sha256', secret).update(ts + '.' + rawBody).digest('hex');
return given.length === want.length && timingSafeEqual(Buffer.from(given), Buffer.from(want));
}Events
| order.updated | An order or quote on one of our shops was created or changed status |
| entitlement.updated | Your partner terms on a brand changed (sent, confirmed, suspended, revoked) |
| application.decided | A decision on your application (approved, more information, rejected) |
| document.reviewed | A document you uploaded was accepted or not |
| deal.decided | A deal registration was approved, declined or extended |
| message.new | Our team wrote to you on the messages page |
| rebate.statement | A rebate statement was approved, settled or withdrawn |
Deliveries are idempotent on X-Portal-Delivery: a retry carries the same id, so keep the ids you have handled. Order events come from the mirror we refresh from the shops every few hours — treat them as “something changed, go read it”, not as a real-time feed.
Limits
Ten keys and five endpoints per company. Thirty most recent deliveries are shown in Settings; the log is kept for 30 days.