Skip to main content
Skip to Content
Cresora Commerce

Api Keys

API key management — list active keys, rotate, revoke.

🔬Planned operations — published for review, not callable
This reference includes operations marked x-cresora-status: planned in the canonical contract: they have no route on any host and return 404 (or 501 for reserved discriminator variants) until released. There is no separate preview stream, no feature flag to enable one, and no enrollment — the badge on each operation tells you whether it is served. See the stable /api/v1 reference for what you can call today. Like the stable API, these operations are server-to-server: there is no interactive console here. Download the preview spec (YAML).

Webhooks

Manage webhook subscriptions — event types, delivery URLs, HMAC secret rotation. See `webhooks:` section for event schemas. **Card-present webhooks.** These events tell your software what happened to a sale it started on a terminal, and to the terminals themselves. None is sent yet. Once Cresora starts sending an event, it can be subscribed to by name and gets its entry under `webhooks:`. | Event | Sent when | | --- | --- | | `sale.created` | Cresora accepted and stored the sale | | `sale.sent` | Cresora sent the sale to the terminal, once; the terminal has not answered yet | | `sale.rejected` | The terminal or Cresora refused the sale, with a reason code and a `retryable` flag | | `sale.in_progress` | The terminal accepted the sale and shows the amount | | `sale.cancel_requested` | Cresora sent your cancel; the terminal has not confirmed it | | `sale.cancelled` | The terminal confirmed the cancel before the point of no return (once the card is read and any PIN or other step it asks for first is done) | | `sale.expired` | The sale's wait time passed before the terminal took it: it was never sent, or the terminal says it never got it | | `sale.completed` | The sale ended approved, partly approved, declined or reversed; read `state` for which | | `sale.failed` | A terminal or gateway error with nothing authorized (also how a sale that was `unknown` ends as `failed`), or a cancel by the clerk or the customer on the terminal; nothing charged; `failure.reason` says which | | `sale.unknown` | No answer in time; the money may or may not be taken: never treat it as declined or as nothing charged | | `terminal.available` | A terminal that refused your last sale as `busy` is free again | | `terminal.offline` / `terminal.online` | The terminal missed two heartbeats in a row, or is back after that; a shorter drop sends nothing | | `terminal.suspended` / `terminal.reinstated` | The terminal was suspended, or brought back | *What each event carries.* A `sale.*` event carries the whole sale: the fields of the sale's read, `GET /terminal-payments/{saleId}`, which is published once it is built, spelled like every webhook `data`: camelCase keys, and amounts as JSON numbers where the read has strings. A `terminal.*` event carries the terminal's whole current state: the fields of the `Terminal` resource and whether it is online. Cresora adds no card data and no customer names. *Keep the highest `version`.* Every sale event carries the sale's `version`, and every terminal event the terminal's. It goes up with every change and never down. Events can arrive out of order, one in between can be skipped, and a redelivery can send an old one again: keep the state with the highest `version` and ignore a lower one. A sale can still change later, with a higher `version`, for example: a sale reported `unknown` that later gets its result, as a new `sale.completed` or `sale.failed`; an approval that is reversed, or a tip change, as a new `sale.completed`; or a chargeback. *Money back.* `approved` says the gateway approved the sale, not that the money is still taken. When you ask for a void or a refund, or the merchant refunds in the portal, you hear its outcome the way you do for an online payment. An approval undone for one of the reasons in `reversal.reason` comes as `reversed`. *A busy terminal.* A sale sent while the terminal is busy with another sale is refused at once: `sale.rejected`, whose `rejection` has reason `busy` and a `busyWith` saying what holds the terminal. Nothing queues. When the terminal is free, Cresora sends `terminal.available` once, for your latest sale it refused `busy`. The two can reach you in either order: once you have both, send that sale again, once, as a new sale with its own `saleId` under a new `Idempotency-Key`; a redelivered `sale.rejected` is not a second refusal. `terminal.available` is a notice, not a change of state: act on it whatever its `version`. If the terminal is busy again, the new sale is refused `busy` too, and the next `terminal.available` follows. *A cancel can come too late.* After `sale.cancel_requested`, the sale can still end other than `cancelled`: it may already be past the point of no return, its result may have come first, or the terminal may have refused the sale. Act on the event with the highest `version`, never on the cancel request.

Capabilities

Query what your partner can do today — enabled features, certification status, MCC scope.