MPS Documentation
Build an integration

Take your first online payment

Create a test payment from a terminal, pay it on the MPS checkout and read it back in five minutes, with one test key.

The developer quickstart. Create a payment with two API calls, pay it on the MPS checkout with a test card, and read it back. In test mode nothing is charged.

Not a developer? A payment link or a shop plugin takes payments without code. Start here to choose.

Five minutes, in a terminal

Before you start

  • A test key (mps_test_…) from Online › API keys on the MPS platform. No test key yet? The merchant creates one; see online payment setup.
  • A terminal with curl and uuidgen, or your language's runtime, and a browser

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.

Set your key

export MPS_API_KEY="mps_test_…"

Every call sends it as Authorization: Bearer. You do not exchange it for anything first.

Create a payment

Amounts are integers in euro cents. The Idempotency-Key makes a retry safe: send the same key again and you get the same payment back, never a second one.

Pick your language. Each example runs as it is with the key from the step above; the choice is kept for the page.

IDEMPOTENCY_KEY=$(uuidgen)   # one per checkout attempt; reuse it to retry this create

curl -sS --fail-with-body -X POST "https://gateway.mps-emi.com/api/payments/internet/create" \
  -H "Authorization: Bearer $MPS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
        "amount": 1995,
        "reference": "order-42",
        "successUrl": "https://example.com/paid",
        "failureUrl": "https://example.com/failed"
      }'
200 OK
{ "data": { "paymentReference": "test-…", "checkoutUrl": "https://pay.mps-emi.com/…" } }

Pay on the checkout

Open checkoutUrl in a browser and pay with card 4111 1111 1111 1111, any future expiry date and any security code. The checkout sends you on to your successUrl.

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.

Read it back

Put the paymentReference from the create in PAYMENT_REFERENCE, then read the payment.

export PAYMENT_REFERENCE="test-…"

curl -sS --fail-with-body "https://gateway.mps-emi.com/api/payments/internet/$PAYMENT_REFERENCE" \
  -H "Authorization: Bearer $MPS_API_KEY"
200 OK
{ "data": { "paymentReference": "test-…", "state": "executed", "amount": 1995, "currency": "EUR", "reference": "order-42" } }

executed means paid. That is your first payment.

Other test cards

Cards that decline or stay pending are under Test mode.

Response

The create answers 200 with:

FieldTypeRequiredDescription
paymentReferencestringYesThe MPS reference of the payment. test-… in test mode. Store it with the order.
checkoutUrlstringYesThe checkout address. Open it exactly as returned.

The read answers 200 with:

FieldTypeRequiredDescription
paymentReferencestringYesThe payment you read.
statestringYespending, executed, failed or abandoned. See Payment lifecycle.
amountintegerYesThe amount in euro cents.
currencystringYesEUR.
amountRefundedintegerYesWhat has been refunded so far, in euro cents. See Refunds.
amountRemainingintegerYesWhat can still be refunded, in euro cents.
referencestringYesYour order reference, as you sent it, or null if you sent none.

Errors

StatusCodeCauseResolution
400—A field is invalid, for example an amount of zero or a successUrl that is not https://.Fix the field the body names. Do not retry unchanged. See Validation errors.
401—No API key, or a wrong or revoked one.Check MPS_API_KEY. Do not retry. See Authentication.
403—The key lacks the scope (internet:create or internet:read), or the merchant has no shop name registered yet.Check the key's scopes, or contact MPS. See Status codes.
404—The read found no such payment for the merchant the key acts for.Check the paymentReference you stored.
409idempotency_key_in_useA create with the same Idempotency-Key is still running.Retry after a second with the same key and body. See Conflicts.
409idempotency_key_expiredThe payment this key made can no longer be returned.Create a new payment with a new key.
429—The key's 100 requests a minute, shared by every endpoint.Wait Retry-After seconds, then retry. See Rate limits.

Then, in your backend

The same calls, on your server. The API key never goes to a browser or an app.

  1. Create the payment, store paymentReference with the order, and redirect the shopper to checkoutUrl. Pass a callbackUrl to receive a webhook when it is paid.
  2. Confirm before you ship. In your webhook handler, verify the signature and timestamp, read the payment, and check its state, amount, currency and reference against the order. Mark the order paid with an update that only succeeds once, and only then answer 2xx. On a failure answer 5xx and MPS retries. This works as long as the handler finishes within 10 seconds. The basic handler shows it, and the production pattern covers the rest.
  3. Handle every state: executed (check the amount), failed, abandoned after 24 hours, and pending until then. See Payment lifecycle.

Integration examples has all of it as one runnable server in C#, TypeScript, Python and PHP. Partner key? Add x-wallet-number with the merchant's wallet. See Choosing the merchant.

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