Skip to Content

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_at is required, in the future and at most ten years ahead; otherwise 422 CREDIT_EXPIRY_REQUIRED.
  • The Idempotency-Key header is required. The same key returns the first grant (200) for good; the same key with a different amount, expiry or reason is 409 IDEMPOTENCY_KEY_REUSED.
  • A lot at or past its expiry is never spent. Its remainder is written off by an expire entry within minutes of the expiry, and credit.expired tells 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.

FieldMeaning
availableCredits that can be spent now: the remainders of unexpired lots.
reservedCredits held by sends in flight.
next_expiryWhen the soonest available credits expire.
next_expiry_amountHow 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:

  1. Reserve. POST /partner/messages holds the template's cost (credits.state: "reserved") in the same step that queues the message. A template that costs 0 reserves nothing ("free").
  2. Settle, exactly once, by Meta's reports:
    • Meta reports the message sent, delivered or read: 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, with credits.state: "released".
  3. 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:

KindEffect
grantA new lot.
reserveCredits held for a send.
consumeHeld credits charged (Meta sent it).
releaseHeld credits given back (failed, or no outcome for 7 days).
expireAn expired lot's remainder written off.
adjustA 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 in credits.unlimited, so you can invoice by usage.
  • credit.low does not fire. The daily limit, opt-outs and a suspension still apply, so set a daily_limit if you want a ceiling.
  • Send {"unlimited_credits": false} to charge the balance again from the next send on.

On this page