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.
Integration examples
A complete server in C#, TypeScript, Python and PHP.
Build with AI
Building with Lovable, Bolt, v0, Cursor or Claude: choose your way, and get a prompt to start from.
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
curlanduuidgen, or your language's runtime, and a browser
Server only
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"
}'{ "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
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"{ "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:
| Field | Type | Required | Description |
|---|---|---|---|
paymentReference | string | Yes | The MPS reference of the payment. test-… in test mode. Store it with the order. |
checkoutUrl | string | Yes | The checkout address. Open it exactly as returned. |
The read answers 200 with:
| Field | Type | Required | Description |
|---|---|---|---|
paymentReference | string | Yes | The payment you read. |
state | string | Yes | pending, executed, failed or abandoned. See Payment lifecycle. |
amount | integer | Yes | The amount in euro cents. |
currency | string | Yes | EUR. |
amountRefunded | integer | Yes | What has been refunded so far, in euro cents. See Refunds. |
amountRemaining | integer | Yes | What can still be refunded, in euro cents. |
reference | string | Yes | Your order reference, as you sent it, or null if you sent none. |
Errors
| Status | Code | Cause | Resolution |
|---|---|---|---|
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. |
409 | idempotency_key_in_use | A create with the same Idempotency-Key is still running. | Retry after a second with the same key and body. See Conflicts. |
409 | idempotency_key_expired | The 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.
- Create the payment, store
paymentReferencewith the order, and redirect the shopper tocheckoutUrl. Pass acallbackUrlto receive a webhook when it is paid. - Confirm before you ship. In your webhook handler, verify the signature and
timestamp, read the payment, and check its
state,amount,currencyandreferenceagainst the order. Mark the order paid with an update that only succeeds once, and only then answer2xx. On a failure answer5xxand 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. - Handle every state:
executed(check the amount),failed,abandonedafter 24 hours, andpendinguntil 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.
Related
- Payment lifecycle: what each state means and what to do with it
- Webhooks: receive and verify webhooks
- Integration examples: one runnable server in four languages
- Production checklist: the checks before you switch to a live key
- Switch to live payments: what the merchant needs before a live key works
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