Credits
Lots with an expiry, spent soonest expiry first, reserved for a send and settled once by Meta's report.
Each sub-customer has its own credits. You decide what you sell them for; Messora keeps the ledger.
Lots and expiry
Credits come in lots. Every grant creates one:
POST /partner/customers/{customerId}/credits
Idempotency-Key: inv-2026-12-1042
{"amount": 500, "expires_at": "2027-01-31T21:00:00Z", "reason": "December package"}expires_atis required, in the future and at most ten years ahead; otherwise422 CREDIT_EXPIRY_REQUIRED.- The
Idempotency-Keyheader is required. The same key returns the first grant (200) for good; the same key with a different amount, expiry or reason is409 IDEMPOTENCY_KEY_REUSED. - A lot at or past its expiry is never spent. Its remainder is written off
by an
expireentry within minutes of the expiry, andcredit.expiredtells you how much.
Spending order (FEFO)
A send takes its credits from the lot that expires first (ties: the older lot), over as many lots as it needs. A negative adjustment does the same.
Balance
Get a sub-customer's credits returns the balance, the open lots in spending order and the ledger's entries, newest first.
| Field | Meaning |
|---|---|
available | Credits that can be spent now: the remainders of unexpired lots. |
reserved | Credits held by sends in flight. |
next_expiry | When the soonest available credits expire. |
next_expiry_amount | How many expire then. |
The balance never goes below zero: a send or a negative adjustment that
needs more than available fails with 402 INSUFFICIENT_CREDITS and
changes nothing.
Reservation and settlement
Every send goes through three steps:
- Reserve.
POST /partner/messagesholds the template's cost (credits.state: "reserved") in the same step that queues the message. A template that costs 0 reserves nothing ("free"). - Settle, exactly once, by Meta's reports:
- Meta reports the message
sent,deliveredorread: the credits are consumed ("consumed"). Meta merely accepting the request is not a report; nothing is charged until Meta's status says so. - Meta reports it
failed, or the attempt fails (a permanent error, a consent block, the account in error): the credits are released ("released") and given back. - No outcome for 7 days: a send whose reservation is still open seven
days after it was made is released, so your customer is never charged
for an outcome nobody knows. You get
message.unknown. If Meta reports the message later after all, nothing is charged; the matching event (message.delivered, …) still arrives, withcredits.state: "released".
- Meta reports the message
- Repeated or concurrent status webhooks never charge or refund twice.
Adjustments
Adjust credits
(POST /partner/customers/{customerId}/credits/adjustments) corrects a
balance with a signed amount and a required reason. A positive one
creates a lot and needs expires_at; a negative one takes credits FEFO and
cannot exceed available.
The ledger
Every change is an append-only entry, one per lot touched:
| Kind | Effect |
|---|---|
grant | A new lot. |
reserve | Credits held for a send. |
consume | Held credits charged (Meta sent it). |
release | Held credits given back (failed, or no outcome for 7 days). |
expire | An expired lot's remainder written off. |
adjust | A signed correction. |
For every lot, the entries add up to its state, and entries are never changed or deleted.
Low credit
credit.low fires once when a customer's available credits fall below
its threshold: its own credit_low_threshold
(PATCH /partner/customers/{customerId}), else your default
(PATCH /partner/settings with {"credit_low_threshold": 100}; null
turns it off). It fires again only after the balance went back to or above
the threshold and fell below it once more.
Unlimited credits
For a customer you bill afterwards, or do not bill at all, switch the credit check off:
PATCH /partner/customers/{customerId}
{"unlimited_credits": true}You can also send unlimited_credits when you create the customer.
- Sends are never refused with
402 INSUFFICIENT_CREDITS, and nothing is taken from the balance. Credits the customer already has are kept, but still expire. - Every send keeps its cost and its state, with
credits.unlimited: true. The usage report adds up the cost of what Meta sent incredits.unlimited, so you can invoice by usage. credit.lowdoes not fire. The daily limit, opt-outs and a suspension still apply, so set adaily_limitif you want a ceiling.- Send
{"unlimited_credits": false}to charge the balance again from the next send on.