Mintcash
Concepts

Payments

The payment state machine — every status, every legal transition, and what triggers each one.

A Payment is the record of one charge attempt against a customer. It's created when you call POST /payments, and it moves through a state machine until it reaches a terminal state (failed, refunded, or voided).

The state machine

Rendering diagram…

Terminal states: failed, refunded, voided. Once a payment reaches one, no more transitions happen.

succeeded is "soft terminal" — most payments stop there, but a refund or void can still move them onward.

Allowed transitions

FromAllowed to
createdpending, authorized, succeeded, failed
pendingauthorized, succeeded, failed
authorizedsucceeded, failed, voided
succeededrefunded, partially_refunded, voided
partially_refundedrefunded, partially_refunded, voided
failed(terminal)
refunded(terminal)
voided(terminal)

Same-status transitions are treated as idempotent — webhooks that arrive twice for the same state change don't break anything.

Out-of-order transitions should be rejected. If a payment is already succeeded and a stale pending webhook arrives, you should refuse the transition and the payment stays succeeded.

Two ways a payment starts

Hosted payment page (HPP)

We give you a redirectUrl; the customer fills the form on the provider's hosted page.

Rendering diagram…

Token charge (saved card)

You have a cardToken from a previous successful charge. The customer doesn't see a payment page — the charge happens server-to-server.

Rendering diagram…

What you receive on each state

Every state transition fires a webhook. The full table is in Webhooks → Event types, but in short:

StateWebhook eventShould you fulfil?
pendingpayment.pendingNo — wait for succeeded
authorizedpayment.authorizedReserve inventory, but don't ship yet
succeededpayment.succeededYes — fulfil the order
failedpayment.failedRelease inventory; inform the user
partially_refundedpayment.partially_refundedUpdate internal balance; partial refund flow may continue
refundedpayment.refundedMark order refunded
voidedpayment.voidedTreat as failed for accounting; release inventory

Always fulfil on the webhook

The synchronous response from POST /payments tells you the request was accepted, not that the customer was charged. Wait for payment.succeeded before granting credit, releasing inventory, or sending a "thanks for your purchase" email.

Idempotency

Every POST /payments accepts an externalId — your unique identifier for that order. If the same externalId arrives twice, MintCash returns the original payment record and never calls the provider again. Use this to make retries safe.

Read more about idempotency →