MPS Documentation
Reference

Errors and rate limits

Every status code the API answers, its error body, the rate limits and the retry policy, with what to do about each one.

Each section below resolves one class of error. The payments API links to it from the error itself, in the documentationUrl of every problem response.

Status codes

StatusMeaningWhat to do
200Success—
201Created: a refund was requested (or replayed for its Idempotency-Key)Read its status
400The request was understood but is invalidFix the field named in the body; do not retry unchanged. See Validation errors
401No API key, or a wrong or revoked oneCheck the key; do not retry. See Authentication errors
403The API key is valid but may not do this: a missing scope, or a merchant (x-wallet-number) your key does not coverCheck the scopes and the wallet; do not retry. See Authentication errors
404Not a published endpoint, or, on the payment read and the refund endpoints, no such payment or refund for this merchantCheck the path and the reference. See Not found
409A conflict, named by the body's codeRetry or stop, as the code says. See Conflicts
429Rate limitedWait Retry-After seconds, then retry. See Rate limits
5xxA problem on the MPS sideRetry reads with backoff; see Server errors for creates

Problem responses

The payments API answers an error with an RFC 9457 problem document. Every problem response of the payments API carries two fields beside status and detail:

FieldTypeRequiredDescription
traceIdstringYesThe W3C trace id of the call, such as 00-a27c57cb…-01. Quote it when you contact MPS about a failed call: it finds that exact call in the MPS logs.
documentationUrlstringYesA link to the section of this page that resolves the error, such as Validation errors for a 400.

The gateway's own 401, 403 and 429 answers have no body, and so no traceId or documentationUrl. The status code is the whole answer. The one exception is the 403 for an x-wallet-number your key does not cover: its body is { "error": "invalid_request", "error_description": "…" } (see Authentication errors).

The traceparent header

Every answer carries a traceparent header naming the call's W3C trace: a success, a problem, and a 401, 404 or 429 that has no body. Log it with every call you make; quote it when you contact MPS about a call, failed or not.

traceparent: 00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01

The second part is the trace id. On a problem response it is the same trace id as in the body's traceId; the part after it can differ, as it names the step in MPS that answered.

Validation errors

A payment endpoint answers a validation failure with 400 and a problem document whose errors object maps each offending field to its messages:

400 Bad Request
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "amount": ["Amount must be greater than zero (in cents)"]
  },
  "traceId": "00-a27c57cb…-01",
  "documentationUrl": "https://docs.mps-emi.com/errors-and-rate-limits#validation-errors"
}

Each key is the field as you sent it in the JSON body (amount, successUrl), or the header (Idempotency-Key). A body that cannot be read at all is refused the same way, naming the field when there is one: a decimal or a string where a whole number of cents belongs, or malformed JSON. Show the messages to a developer, not to a shopper: they are written in English for integrators.

Fix the named field and send the request again. Do not retry it unchanged.

Authentication errors

StatusCodeCauseResolution
401—No API key, or a wrong or revoked one. No body.Check the key; do not retry. See API key errors.
403—The API key is valid but lacks the endpoint's scope. No body.Use a key that holds the scope. See Scopes.
403invalid_requestThe x-wallet-number is not one of your merchants. The body is { "error": "invalid_request", "error_description": "…" }.Send a wallet your key covers. See Choose the merchant.
403—Create a payment with a partner key and no x-wallet-number. No body.Send x-wallet-number on every call. See Choose the merchant.
403—Create a payment: the merchant has no shop name registered yet. No body.Contact MPS.

Not found

A 404 carries no body. It means one of two things:

  • The path is not a published endpoint. Check the path against the API reference.
  • On the payment read and the refund endpoints: no such payment or refund for the merchant the key acts for. The reference has a typo, changed on the way (trimmed, re-cased, parsed as a UUID), or belongs to a different merchant than the one the payment was created for. With a partner key, read it with the same x-wallet-number.

Do not retry a 404 unchanged.

Conflicts

A 409 is a problem document with a stable code beside its detail. Decide on the code: it never changes, while detail is English text for a person and can be reworded at any time.

409 Conflict
{
  "status": 409,
  "detail": "A payment with this Idempotency-Key is still being created; retry shortly",
  "code": "idempotency_key_in_use",
  "traceId": "00-a27c57cb…-01",
  "documentationUrl": "https://docs.mps-emi.com/errors-and-rate-limits#conflicts"
}
codeWhereMeaningRetry?
idempotency_key_in_useCreate a payment, refund a paymentThe first request with this Idempotency-Key is still runningYes, after a second, with the same key and body
refund_in_progressRefund a payment, cancel a refundAnother refund of the same payment is being changed at this momentYes, after a second
idempotency_key_expiredCreate a paymentThe key is still kept, but the payment it made can no longer be returned (rare). After 24 hours a key is not kept at all and opens a new payment instead: see Retrying safelyNo: create a new payment with a new key
payment_not_refundableRefund a paymentThe payment is not executedNo
refund_not_cancelableCancel a refundThe refund was sent or decidedNo: read it
payment_link_not_openCancel a payment linkThe link is paid or expired, so there is nothing left to cancelNo: read the link
payment_link_unnamedCreate a payment linkThe merchant has no shop name, which the shopper would seeNo: ask MPS to set it

New codes may be added. Treat a 409 with a code you do not know as one not to retry.

Rate limits

Limit
Requests per API key100 per minute, across every endpoint

The limit counts per API key: creates, reads and refunds share it. A test key and a live key each have their own; a partner key has one for all the merchants it acts for. The minute is a fixed window, not a rolling one: all 100 calls may come at once, and the count starts again when the window ends. Over the limit the answer is 429 Too Many Requests at once, with a Retry-After header giving the seconds to wait. Nothing is queued.

A 429 also comes from too many failed keys from one address. See API key errors.

Reuse connections. Send your calls over kept-alive connections (HTTP/1.1 keep-alive or one HTTP/2 connection) from an HTTP client that pools them, as every common HTTP client does by default. Opening many new connections at the same moment from one address can be refused at the network edge, before the request reaches the API, as a reset connection rather than a 429. A pooled client does not run into it. Retry a reset like a network error.

Budget for polling. Reading four payments every 2 seconds is already 120 reads a minute. Poll only while a shopper is on your return page, at most every 2 seconds and for about 30 seconds, then let the webhook settle the order. Reconcile older orders on a schedule, spread out, with backoff. See Reconcile what you did not hear about. If your volume needs more, ask MPS.

Server errors

A 5xx is a problem on the MPS side. A 500 from the payments API is a problem document with a traceId and a documentationUrl; other 5xx answers can carry no body.

  • Reads are safe to retry with backoff.
  • A create with an Idempotency-Key is safe to retry with the same key and the same body: you get the payment the first call made, or a new one if it made none.
  • A create without a key is not safe to retry: the retry may open a second payment.

The Retry policy lists every operation. Quote the traceId when you contact MPS.

By endpoint

POST /api/payments/internet/create

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.
StatusBodyCommon causes
200{ "data": { "paymentReference", "checkoutUrl" } }—
400Problem document with errors per field (see Validation errors)amount of zero or missing; successUrl / failureUrl missing or not https://; a callbackUrl that is not an absolute HTTPS URL on a public host; an Idempotency-Key reused for a different request, or Idempotency-Key and X-Idempotency-Key naming different keys
401noneNo API key, or a wrong or revoked one
403none, or { "error", "error_description" }The key lacks internet:create; a partner key sent no x-wallet-number, or one it does not cover (with a body); or the merchant has no shop name registered yet (contact MPS)
409Problem document with a codeidempotency_key_in_use: a create with the same Idempotency-Key is still running; retry shortly. idempotency_key_expired: create a new payment with a new key
429none, Retry-After headerThe key's 100 requests a minute, shared by every endpoint (Rate limits)
5xxSee Server errorsOn the MPS side: do not retry blindly, see Retry policy

GET /api/payments/internet/{paymentReference}

StatusBodyCommon causes
200{ "data": { "paymentReference", "state", "amount", "currency", "amountRefunded", "amountRemaining", "reference" } }—
401noneNo API key, or a wrong or revoked one
403noneThe key lacks internet:read
404noneNo such payment for the merchant the key acts for, or a partner key sent no x-wallet-number (see Not found)
429none, Retry-After headerThe key's 100 requests a minute, shared by every endpoint (Rate limits); poll every 2 seconds at most

POST /api/payments/{paymentReference}/refunds

StatusBodyCommon causes
201{ "data": { "refundId", "status", … } }, Location header—
400Problem document with errors per field (see Validation errors)a malformed paymentReference; amount zero or less, or more than is left; nothing left to refund; an unknown reason; an Idempotency-Key reused for a different request, or with spaces or other characters than letters, digits and punctuation
401noneNo API key, or a wrong or revoked one
403none, or { "error", "error_description" }The key lacks payments:refund; a partner key sent no x-wallet-number, or one it does not cover (with a body)
404noneNo such payment for this merchant, or a test key on a live payment (or the reverse)
409Problem document with a codeidempotency_key_in_use or refund_in_progress: retry shortly. payment_not_refundable: the payment is not executed
429none, Retry-After headerThe key's 100 requests a minute, shared by every endpoint (Rate limits)

GET /api/payments/{paymentReference}/refunds/{refundId} and GET /api/payments/{paymentReference}/refunds

StatusBodyCommon causes
200{ "data": { "refundId", "status", … } }, or { "data": [ … ] } for the list—
401noneNo API key, or a wrong or revoked one
403none, or { "error", "error_description" }The key lacks payments:refund; a partner key sent no x-wallet-number, or one it does not cover (with a body)
404noneNo such payment for this merchant, or no such refund under it
429none, Retry-After headerThe key's 100 requests a minute, shared by every endpoint (Rate limits)

DELETE /api/payments/{paymentReference}/refunds/{refundId}

StatusBodyCommon causes
204noneCanceled, or canceled before
401noneNo API key, or a wrong or revoked one
403none, or { "error", "error_description" }The key lacks payments:refund; a partner key sent no x-wallet-number, or one it does not cover (with a body)
404noneNo such refund of this payment for this merchant
409Problem document with a coderefund_not_cancelable: it was sent or decided; read it. refund_in_progress: retry shortly
429none, Retry-After headerThe key's 100 requests a minute, shared by every endpoint (Rate limits)

Retry policy

OperationRetry onDo not retry on
Create a payment (with an Idempotency-Key)5xx, a network error or a timeout: same key, same body. 409 idempotency_key_in_use: after a second. 429: after Retry-After.400, 401, 403, 409 idempotency_key_expired
Create a payment (without a key)429 only5xx or a timeout: the retry may open a second payment. Create a fresh one and abandon the first
Read a payment5xx, a network error, 429 (after Retry-After): with backoff (1 s, 2 s, 4 s…, capped)400, 401, 403, 404
Refund a payment5xx, a network error or a timeout: same key, same body. 409 idempotency_key_in_use or refund_in_progress: after a second. 429.400, 401, 403, 404, 409 payment_not_refundable
Cancel a refund5xx, a network error, 409 refund_in_progress, 429. A repeated cancel is safe: a canceled refund answers 204 again.404, 409 refund_not_cancelable

Back off with jitter (a random part of the wait), and give up after a handful of attempts: a request that keeps failing is something to look at, not to repeat.

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