MPS Documentation
Build an integration

Create a payment link with the API

Make a one-time payment link for a fixed amount with your API key, send it to a shopper, and follow whether it is paid.

A payment link asks one shopper for one payment of a fixed amount. You make it with the API, send the returned url to the shopper, and read the link to see whether it was paid. The shopper pays on the MPS checkout, so you never handle a card.

The same links are also made on the MPS platform, without code: see Send a payment link.

Test links and live links

A test key (mps_test_…) makes test links: they charge nothing and you can pay them yourself. A live key (mps_live_…) makes live links, which take real money into your balance. A partner's key makes test links only: a live link is made by the merchant itself.

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.

Before you start

  • An API key that holds the payment-links:create and payment-links:read scopes. A key issued from this release on holds them; for an older key, ask MPS to add them.
  • For a live link: your merchant's shop name on the MPS platform, which the shopper sees on the checkout. A link without one is refused.

A link is single use and stays open for the number of days you choose, 10 by default and 90 at most. It stops opening payments when it is paid, canceled or expired. Paid is final.

# Make a link for EUR 19.95, open for 10 days
# Prerequisite: export MPS_API_KEY=mps_test_…
curl -sS --fail-with-body -X POST "https://gateway.mps-emi.com/api/payments/payment-links" \
  -H "Authorization: Bearer $MPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 1995, "reference": "INV-42", "expiresInDays": 10, "locale": "nl"}'

The gateway answers 201 Created with the link in data. The Location header points at the link. Store id with your invoice, and send the shopper url.

Request body

FieldTypeRequiredDescription
amountintegerYesAmount in euro cents, from 1 to 5000000. 1995 = EUR 19.95.
referencestringYesYour reference, shown to the shopper and in your list. Letters A-Z, digits, spaces and . _ : / # + -; at most 64 characters.
expiresInDaysintegerNoDays the link stays open, from 1 to 90. Defaults to 10.
localestringNoen, nl or fr: the language of the link page and the checkout. Without it, the shopper's browser decides.

The merchant, the mode and the shop name come from your key. A body that names a test flag or a shop name has them ignored.

Send the shopper url, by e-mail, chat, text message or as a QR code. It opens the checkout with your shop name, the amount and your reference. The shopper can open the link more than once: while a payment is pending on it, the link opens that same checkout, so it cannot be paid twice.

# Read one link of your merchant
curl -sS --fail-with-body "https://gateway.mps-emi.com/api/payments/payment-links/k3Qz9aVbN2xR7wYc1dFgHw" \
  -H "Authorization: Bearer $MPS_API_KEY"

To list your links, newest first, call GET https://gateway.mps-emi.com/api/payments/payment-links with the same header. Read a link again until its state is no longer open.

# Stop an open link opening payments
curl -sS --fail-with-body -X DELETE "https://gateway.mps-emi.com/api/payments/payment-links/k3Qz9aVbN2xR7wYc1dFgHw" \
  -H "Authorization: Bearer $MPS_API_KEY"

A canceled link opens no new payment. A payment already on its checkout can still be paid, and then the link reads paid: cancelling never turns a paid payment into anything else. Canceling a canceled link answers 204 again.

Response

A link in data:

FieldTypeDescription
idstringThe link's identifier. An opaque string: never parse it.
urlstringThe address to send the shopper to.
amountintegerThe amount in euro cents.
referencestringYour reference, as you sent it.
statestringopen, paid, canceled or expired. Paid is final.
testbooleantrue for a test link.
createdAtstringWhen the link was made.
expiresAtstringWhen the link stops opening payments.
paidAtstring or nullWhen the link was paid.
canceledAtstring or nullWhen the link was canceled.
paymentReferencestring or nullThe payment the link was paid by.
paymentsarrayEvery payment the link opened, oldest first, each with its paymentReference and state.
localestring or nullThe language the link page opens in.
201 Created
{
  "data": {
    "id": "k3Qz9aVbN2xR7wYc1dFgHw",
    "url": "https://pay.mps-emi.com/link/k3Qz9aVbN2xR7wYc1dFgHw",
    "amount": 1995,
    "reference": "INV-42",
    "state": "open",
    "test": true,
    "createdAt": "2026-11-18T09:14:03Z",
    "expiresAt": "2026-11-28T09:14:03Z",
    "paidAt": null,
    "canceledAt": null,
    "paymentReference": null,
    "payments": [],
    "locale": "nl"
  }
}

Errors

StatusCodeCauseResolution
400—A field is out of range, or the reference is missing or has characters not allowed. The body names the field.Fix the field the error names.
401—No API key, or an unknown one.Send a valid key as Authorization: Bearer.
403—The key lacks the scope, or a partner's key sent no x-wallet-number.Ask MPS for the scope, or name the merchant (see Choosing the merchant).
403payment_link_live_partnerA partner's key asked for a live link.Make a test link, or have the merchant make the live link itself.
404—No such link for this merchant.The same answer as for a link that does not exist.
409payment_link_unnamedThe merchant has no shop name, which the shopper would see.Ask MPS to set the shop name, then try again.
409payment_link_not_openThe link is paid or expired, so it cannot be canceled.Nothing to cancel. Make a new link if the shopper still needs to pay.
429—More than 100 requests a minute from this key.Wait for the Retry-After seconds.

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