MPS Documentation

Build with an AI coding assistant

Point Cursor, Claude Code, Copilot or Codex at the MPS documentation and a ready-made prompt, then check what it wrote before you go live.

A coding assistant in your own project writes the integration with you: the backend calls, the return page and the webhook route. Give it the exact contract and the prompt below, and check its work against the mistakes assistants make.

Before you start

  • A test key (mps_test_…) and its signing secret from Online › API keys on the MPS platform
  • Cursor, Claude Code, Copilot, Codex or another assistant that edits your project

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.

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.

Give it the documentation

An assistant that fetches URLs only needs /llms.txt: it follows the links to the pages it needs. One that cannot fetch needs /llms-full.txt attached or added to the project. For a typed client, give it /openapi.json as well. See Ask a chat assistant for every file.

Paste this prompt

Replace the bracketed parts:

You are helping me integrate the MPS payment gateway.
Read the MPS documentation at https://docs.mps-emi.com/llms.txt and follow it exactly;
do not invent endpoints, fields or headers that are not documented there.

My stack: [e.g. Node.js 22 + Express backend].
I have these scopes: [internet:create internet:read].
My API key covers [one wallet | several merchant wallets].

Build:
1. A backend module that sends my API key in the Authorization header as a Bearer key on
   every call, keeping the key server-side.
2. A checkout endpoint that stores the order with a new Idempotency-Key, creates an online
   payment sending that key (retrying a failed create with the same key and body), stores
   paymentReference with the order, and redirects the shopper to checkoutUrl.
3. A return handler that reads the payment on the backend and marks the order paid only on
   executed with the full amount, with an update that only succeeds once.
4. A webhook receiver that verifies the signature and timestamp, stores the webhook in a
   database inbox keyed on X-Mps-Delivery-Id, and only then answers 2xx — no work started
   after answering. A worker processes the inbox: reads the payment, checks state, amount,
   currency and reference against the order, settles it once, retries temporary failures with
   backoff and records permanent ones.
Include error handling for every status code in the docs.

Check what it wrote

Go through the Errors below: each is a mistake assistants make often.

Test every case

Run the cases in Test every case with the test cards before you switch to a live key.

Errors

What the assistant didWhat happensFix
Added an OAuth exchangeAn API key is sent as it is on every call; there is nothing to exchange it for.Send the key in Authorization on every call. See Authentication.
Put the API key in a browser or an appAnyone can read it and create payments for you.Keep it on your backend only.
Called the API from the pageThe gateway allows no CORS: the call fails.Call it from a server function.
Opened the checkout in a frame, or a tab after an awaitA gray screen, or a blocked popup.Open the tab in the click handler, then point it at checkoutUrl. See Open the checkout.
Sent a merchant header with a merchant keyA test or merchant key acts for its own wallet.Only a partner key names the merchant, with x-wallet-number.
Sent amounts in euros19.95 is refused, 19 asks for 19 cents.Every amount is an integer number of cents.
Invented a discount fieldThere are no discount fields: a payment takes one price.Send the final price in amount.
Retried a create without an Idempotency-KeyA retry opens a second payment.Generate a key once per checkout attempt and retry with the same key and body.
Trusted the success URLAnyone can open it: an order is marked paid that was not.Confirm with the read endpoint first.
Answered the webhook, then worked in the backgroundWork after the 2xx is lost if the process stops, and the webhook is not sent again.Store it first, then answer. See Webhooks.

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