MPS Documentation
Build an integration

Payment lifecycle

The states an online payment moves through, how the checkout redirect, the webhook and the read fit together, and what to do with each outcome.

An online payment starts pending and ends in one of three states: executed, failed or abandoned. Your backend learns which one from the read endpoint; the shopper's return and the webhook only tell you when to read.

Server only

The API cannot be called from a browser. The gateway answers no cross-origin (CORS) requests, and the API key must never reach a browser. Call it from your server.

States

create

paid

declined or failed

nothing paid for 24 hours

late ANNA payment

late ANNA payment

pending

executed

failed

abandoned

Not paid. Also the state after the
shopper cancels on the checkout page,
or after five cards that were neither
approved nor declined.

Paid. Compare amount with the
order total: a partial approval
reports less than you asked for.

stateTriggerFinalTimeoutWhat you do
pendingYou create the payment. Not paid yet: the shopper may still be on the checkout, or cancelled it and was sent to your failure URL.NoBecomes abandoned 24 hours after it was created, if still unpaid.Never treat it as paid. Poll on return, then let the webhook or a later read settle it. See pending.
executedThe payment is paid. amount is the amount actually approved.Yes—Compare amount with the order total, then fulfil once. See executed.
failedThe card was declined or the payment did not go through.Yes, except for a late ANNA payment—Offer a new payment. See failed.
abandonedNot paid within 24 hours of being created. The checkout no longer takes a payment for it.Yes, except for a late ANNA payment—Release held stock, or create a new payment. See abandoned.

executed never changes. failed and abandoned change only when an ANNA bank payment the shopper started on the checkout completes afterwards: the payment becomes executed and sends payment.received. See A late ANNA payment. A state you do not recognise is pending, never paid.

From create to fulfilment

MPS checkoutMPS APIYour backendMPS checkoutMPS APIYour backendStore paymentReferencewith the order firstalt[Paid][Declined or failed][Cancelled]The return and the webhook arrive in either order, or only one of themLater, a worker reads the paymentpar[The shopper's return][The webhook (once the payment is received and booked, and acallbackUrl was passed)]Fulfil once, on whichever comes first:state is executed and amount equals the order totalShopperPlace order1POST /api/payments/internet/createAuthorization: Bearer API keyIdempotency-Key: one per checkout attempt2paymentReference, checkoutUrl3303 to checkoutUrl4Pay by card, or by ANNA5Redirect to successUrl6Redirect to failureUrl7Redirect to failureUrl, still pending8Lands on your return URL9GET /api/payments/internet/{paymentReference}10state, amount11POST callbackUrl, payment.receivedsigned with X-Mps-Signature12Verify the signature and timestamp(401 if invalid)13Store it, keyed on X-Mps-Delivery-Id(5xx if that fails)142xx, only now15GET /api/payments/internet/{paymentReference}16state, amount17Shopper

Points the diagram cannot show:

  • Nothing is appended to your return URLs. Match the return to its order by your own order id in the URL, or by the paymentReference you stored before redirecting.
  • The return and the webhook arrive in either order, and a shopper who closes the tab never returns at all. Settle the order on whichever comes first, after reading the payment, and make the second a no-op: key on paymentReference.
  • payment.received is the only payment webhook. It is sent once a payment has been received and booked — for a test payment, once it is executed. A failed, abandoned or still pending payment sends nothing. Its refunds send their own events once decided (refund.refunded, refund.failed, refund.canceled; see Webhooks). No callbackUrl, or no signing secret on your key, and nothing is sent either.
  • Delivery is at least once. A webhook is attempted up to six times over about 8½ hours; see Delivery.

Warning

Landing on successUrl is not proof of payment. Verify the webhook signature, read the payment, and check its state, amount, currency, and reference before marking an order paid.

Processing a webhook

Verify the webhook, then either read the payment, settle the order and answer 2xx (process, then answer), or store the webhook, answer 2xx and settle the order from a worker (store, answer, process), as the integration examples do.

Handling each outcome

pending

Never treat it as paid. On the shopper's return, poll the read every 2 seconds for up to about 30 seconds. If it is still pending, show "we are confirming your payment" and let the webhook or a later read settle the order. Do not poll faster: payment requests are limited to 100 a minute.

A shopper who cancelled on the checkout page lands on your failure URL with the payment still pending, and can still pay it: send them back to the same checkoutUrl. After five cards that were neither approved nor declined (see Card attempts) the checkout refuses more cards and does not send the shopper back; the payment stays pending.

executed

The payment is paid. Compare amount with the order total before you ship: on a partial approval it is less than you asked for, and this field is the only signal. Fulfil the order once, even if the webhook and the return both report it.

A partial approval (amount less than the order total) is paid, but not in full. Do not ship it. Either refund it (Refund a payment, with no amount) and ask the shopper to pay again with a new payment, or settle the difference with them yourself. Never mark the order paid in full.

Fulfil once, act once. Marking the order paid with an update that only succeeds once (… WHERE paid_at IS NULL) makes the record exact. Shipping, an e-mail or a call to another system can still fail or run twice. Record what must happen in the same database commit that marks the order paid (an outbox table), and have a worker carry it out, with an idempotency key of its own towards the other system.

failed

The card was declined or the payment failed. Let the shopper try again with a new payment: create is per checkout attempt, and a failed payment takes no new card. Keep the order open rather than cancelling it on the first decline: see A late ANNA payment.

abandoned

Nothing was paid within 24 hours of the payment being created, so MPS gave up on it and the checkout stops taking a payment for it. No webhook is sent. Release any stock you held, or create a new payment if the shopper comes back. Until those 24 hours are up an unpaid payment is pending: the shopper may still come back to the checkout page and pay.

A late ANNA payment

The checkout also offers ANNA, a bank payment the shopper confirms in their banking app. A shopper can start one, then let the payment fail on a card or expire, and complete the bank payment afterwards. The money then arrives: the payment turns executed and payment.received is sent, even though you already saw failed or abandoned.

Keep handling payment.received for orders you closed. Reopen and fulfil the order, or refund the payment if you can no longer deliver.

Reconcile what you did not hear about

The webhook is the fast path, not a guarantee: it can be given up after its last retry, and only a received payment sends one. For any order still waiting, read the payment by its paymentReference — the read is always authoritative.

A schedule for the orders still open:

  1. Every 15 minutes, take the orders that have a paymentReference and are neither settled nor closed.
  2. Read each one, spread over the run rather than all at once: it shares the rate limit with your checkout.
  3. Act on the state. executed: settle it once, as above. failed or abandoned: close the order or offer a new payment. pending: leave it for a later run, reading it less often as it ages (15 minutes, then hourly).
  4. Stop at 24 hours. An unpaid payment reads abandoned 24 hours after it was created. Only a late ANNA payment changes it after that, and that sends payment.received.
  5. Escalate what does not resolve: a read that keeps failing, or a payment still pending well after 24 hours. That needs a person, not another retry.

What this schedule does not cover: a late ANNA payment that arrives after you stopped reading, when every delivery of its payment.received failed. The payment reads executed, but nothing tells you. Keep the paymentReference of every payment an order had, closed orders included, so it can always be read. If your business must catch this case, keep reading the failed and abandoned payments of closed orders once a day, at a low rate, for as long as you would still fulfil or refund such an order. Money you cannot match to an order: contact MPS with the paymentReference, the time (UTC) and state of your last read, and the traceparent header of that read.

A create whose answer you never got has no paymentReference to read. Send the same request with the same Idempotency-Key within 24 hours: you get the payment it made, or a new one if it made none. There is no search by your own reference, which is why the key is stored before the call.

Need help? Contact MPS at contact@mps-emi.com or +32 55 89 09 77, or the MPS partner you work with. What to include.

Building with an AI assistant? Give it llms.txt, every page in llms-full.txt, this page as Markdown, or the OpenAPI document. See Build with AI.

Last updated on

On this page