MPS Documentation
Build an integration

Authentication

Your backend sends its MPS API key in the Authorization header of every call.

Your backend authenticates every call with an API key: one string, sent on every request. There is nothing to fetch, cache or refresh first.

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.
POST https://gateway.mps-emi.com/api/payments/internet/create
Authorization: Bearer mps_test_…
Content-Type: application/json
Idempotency-Key: 4f9c2e1a-7b3d-4c8e-9a1f-0d6e5b2c7a91

The MPS platform issues an API key, together with a webhook signing secret, when you generate a test key or a live key in Online. Both are shown once: store them in your backend's vault or environment straight away.

Server to server only

An API key acts for your merchant until it is revoked. Never put it in a browser, a mobile app or a POS front end: anything shipped to a device can be extracted from it. Let the app call your backend, and your backend call MPS.

The API key

mps_live_<key id>_<secret>
mps_test_<key id>_<secret>
PartMeaning
mps_live_ / mps_test_A live key takes real payments. A test key takes test payments on your own wallet: nothing is charged, booked or paid out.
<key id>12 lower-case letters and digits. Not confidential: it is how MPS and the platform's key list refer to the key.
<secret>The confidential part. It can itself contain _.

Treat the whole string as one opaque value: copy it exactly, never split it or build it yourself.

Send the key

Send the key on every call in the Authorization header, with the Bearer scheme:

Authorization: Bearer mps_live_…

That is the only place it is read: not a query parameter, not an X-Api-Key header, not HTTP Basic.

# Prerequisite: export MPS_API_KEY=mps_test_… and PAYMENT_REFERENCE=<a paymentReference from create>
curl -sS --fail-with-body "https://gateway.mps-emi.com/api/payments/internet/$PAYMENT_REFERENCE" \
  -H "Authorization: Bearer $MPS_API_KEY"

Both print the payment, with its state and amount.

Test keys and live keys

A test key works on the same host and the same endpoints as a live key, so the only thing that changes when you go live is the key. Test payments are recognisable on their own: their payment reference starts with test-. See Accept a payment › Test mode.

Keys are created under Online › API keys on the MPS platform, test and live alike, each with a name so you recognise it. You can hold several test keys at once, for example one per shop or developer. A live key can be created once the merchant it is for has signed its contract with MPS; until then test keys work as usual. API keys do not expire, test or live: a key works until you revoke it.

Choose the merchant

Every payment is for exactly one merchant wallet. Which one depends on the kind of key you hold:

Your keySend x-wallet-number?
A test key (mps_test_…)No. It acts for your own wallet, in test mode; a header you send is ignored.
A merchant key, issued for your own walletNo. It acts for that wallet; a header you send is ignored.
A partner key (you take payments for merchants you onboard)Yes, on every call, even while you have only one merchant: x-wallet-number: BE0000000000.
POST https://gateway.mps-emi.com/api/payments/internet/create
Authorization: Bearer mps_live_…
x-wallet-number: BE0000000000
Content-Type: application/json
Idempotency-Key: 4f9c2e1a-7b3d-4c8e-9a1f-0d6e5b2c7a91

The wallet you name must be one of your merchants. Anything else is refused with 403 and the same message: another merchant's wallet, or one that cannot trade. A key cannot be used to discover wallets:

403 Forbidden
{ "error": "invalid_request", "error_description": "The requested wallet is not covered by this key's account." }

Without x-wallet-number, a partner key names no merchant. Creating a payment then answers 403 with no body, and reading one answers 404.

An integration that still sends the header's former name, x-card-number, keeps working. Send one of the two: naming two different wallets answers 403 with invalid_request.

Send the wallet number exactly as MPS shows it: upper case, no spaces, such as BE0000000000. Read back a payment with the same wallet it was created with: a payment created for one merchant cannot be read as another.

Keep the key on your backend

MPS shows the confidential part once and stores it hashed. It can only be replaced, never recovered.

  • Keep it in your backend's vault or environment, never in source control.
  • Never send it to a browser, an app or a POS front end, and never log it. Its mps_live_ / mps_test_ prefix makes a key quick to find in logs and repositories, and for leak scanners to flag.
  • Use a test key everywhere except production.

Rotate a key

Rotate a key, test or live, without downtime:

Create a new key under Online › API keys. Your old key keeps working.

Deploy the new key to your backend and confirm calls succeed with it.

Revoke the old key on the same screen.

Every key issued in the MPS platform, test or live, comes with its own webhook signing secret: deploy the new key's signing secret with it.

Revoke a key at once if you think it has leaked. Revocation takes effect within about 30 seconds; after that, every call with the key answers 401.

Scopes

Every endpoint needs a scope:

ScopeGrants
internet:createCreate an online (card) payment
internet:readRead an online payment's status
payments:refundRefund a payment, and read and cancel its refunds. A live key holds it only on request; every test key holds it. See Refunds.
payment-links:createMake a payment link, and cancel one. A partner's key makes test links only. See Create a payment link with the API.
payment-links:readList and read payment links.
registration-links:manageMake, list, read and revoke a live partner's personal registration links. Held by the live key a live partner makes for itself; a merchant's key, a partner's key for a merchant and a test key never hold it. See Create a registration link.

Every key holds internet:create and internet:read. A test key also holds payments:refund and the payment-link scopes; a live key holds the payment-link scopes from this release on, and payments:refund only when MPS granted it. A live key holds it only once MPS granted it, so ask for it when you request the key. A call that needs a scope the key does not hold answers 403.

API key errors

StatusCodeCauseResolution
401—The key is wrong, malformed or revoked, or sent to a host other than gateway.mps-emi.com. The response carries WWW-Authenticate: Bearer error="invalid_token".Check the key; do not retry in a loop. See Authentication errors.
403invalid_requestThe x-wallet-number you sent is not one of your merchants. Body as shown above.Send a wallet your key covers.
403—Create a payment with a partner key and no x-wallet-number. No body. A read without it answers 404.Send x-wallet-number on every call.
403—The key is valid but lacks the endpoint's scope. No body.See Scopes.
429—Too many failed key attempts from your address (more than 10 in a minute).Wait Retry-After seconds and fix the key before trying again. See Rate limits.

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