Skip to main content

Worked incentives samples

The endpoint list below documents every operation’s parameters; this overlay walks an incentive the way a promotions API actually uses it: browse the provider catalog → issue an incentive → list the issued ledger → handle a redeem or void. Success envelopes are { data, meta }, error envelopes { error, meta } — see How to read a worked sample. The standalone promotions engine is state-projected over the tenant cdp_events ledger (the same append-only store the loyalty layer uses), so issuance is migration-free and a read always converges. Every response carries meta.request_id. Quote the request id when you report a credit that landed on the wrong ledger — a support trace needs both the incentive_id and the request id.

1. Browse the provider catalog

GET /api/v1/incentives/providers returns every incentive fulfillment provider the engine can call: the internal Orbit credit ledger, the discount-code minter, external gift-card networks (Tremendous/Tango style), and any custom fulfillment. Use this to drive the reward-source picker or to decide which provider_id to override on the issue call.
200

2. Issue an incentive

POST /api/v1/incentives/issue creates one incentive — a credit, a discount code, a gift card, or a custom payout — and records the outcome on the tenant cdp_events ledger. The body is the issueBodySchema: required reward_type (one of credit, discount_code, gift_card, custom), optional amount, provider_id (when omitted the engine picks a default per reward type), and the fulfillment payload the provider returns. A write of this kind is gated to owner, admin, or developer roles — the same guard the referral reward-payout surface uses.
200

3. List the issued ledger

GET /api/v1/incentives/issued returns every incentive the tenant has issued, newest first, with its reward type, provider, amount, and status. Use this to drive a win-back report or the org’s own incentive audit before you call redeem or void.
200

4. Errors

Errors follow the { error, meta } envelope. Two failures every promotions integrator hits: 403 — role too low for a write.
403
422 — unknown provider or wrong reward semantics. An override that names a provider the catalog cannot resolve, or an amount that picks a negative debit:
422