Payload reference
Compact lookup table of every event Osigu emits. Use this page as a quick reference; click through for the full payload shape and the "what to do" guidance.
Full event-type catalogue
event_type | Family | Trigger | Full payload |
|---|---|---|---|
authorization.created | Authorizations | Sponsor approved a PENDING_SPONSOR request | authorization.created |
authorization.rejected | Authorizations | Sponsor denied a request | authorization.rejected |
authorization.updated | Authorizations | Sponsor modified an existing authorization | authorization.updated |
authorization.voided | Authorizations | Authorization cancelled (provider / sponsor / expiry) | authorization.voided |
dispensing.started | Dispensing | Pharmacy called startDispensation | dispensing.started |
dispensing.completed | Dispensing | Dispensation finalised | dispensing.completed |
dispensing.cancelled | Dispensing | STARTED dispensation voided | dispensing.cancelled |
prescription.issued | Prescriptions | Prescription created (any version) | prescription.issued |
prescription.email_delivered | Prescriptions | Notification email accepted by receiver | prescription.email_delivered |
prescription.email_failed | Prescriptions | Notification email bounced | prescription.email_failed |
settlement.paid | Settlements | Dominican Republic sponsor paid a batch | — |
settlement.rejected | Settlements | Sponsor rejected a batch | — |
settlement.partially_accepted | Settlements | Mixed outcome per claim | — |
settlement.* events are documented in the Submit a settlement batch guide.
Envelope fields
Every event, regardless of family, carries the same top-level shape. Recap:
| Field | Type | Description |
|---|---|---|
event_id | string | Unique, stable — use for dedupe. |
event_type | string | Dot-namespaced type. |
created_at | ISO 8601 | Emission time. |
api_version | date | Envelope schema version. |
environment | sandbox | production | Source environment. |
data | object | Family-specific payload. |
provider | object | { provider_id, provider_slug } — the provider the event scopes to. |
Type sniffing quickly
Common routing patterns:
// Prefix match on family
switch (event.event_type.split('.')[0]) {
case 'authorization': return handleAuth(event);
case 'dispensing': return handleDispense(event);
case 'prescription': return handleRx(event);
case 'settlement': return handleSettle(event);
default: return log('unknown event', event.event_type);
}
// Exact match
if (event.event_type === 'dispensing.completed') { /* ... */ }
// Glob-style
if (event.event_type.startsWith('authorization.')) { /* ... */ }
Field additivity
Fields inside data may be added at any time — we only bump api_version for breaking changes (removals or semantic changes). Design your parser to ignore unknown fields.
Related
- Introduction — envelope shape and delivery guarantees.
- Signature verification.
- Concept: Webhooks.