# MPS Payments documentation > Take online payments with MPS: payment links without code, shop plugins for WooCommerce, Odoo, Magento and PrestaShop, and the payments API for your own integration. Key facts: - Authenticate with an API key (`mps_live_…`, or `mps_test_…` for a test key): send it as `Authorization: Bearer ` on every call to the payment endpoints. You do not exchange it for anything else, and a key does not expire. - The API host is `https://gateway.mps-emi.com`; the checkout page is on `https://pay.mps-emi.com`. In live mode the checkout leads with an ANNA (pay by bank) QR code, with the card form behind it; in test mode it shows the card form only. There is one environment and no separate test host: a test key (`mps_test_…`) takes simulated payments on the same hosts. - An online payment's `paymentReference` is an opaque string (a GUID, or `test-` + GUID for a test key) — never validate it as a UUID. Nothing is appended to the success/failure URLs, and the checkout page cannot be shown in an iframe. - Every call acts for exactly one merchant wallet. A test or merchant key acts for its own wallet and ignores `x-wallet-number`; a partner key names the merchant with `x-wallet-number` on every call. - Amounts are integers in cents (1995 = EUR 19.95). A payment takes a single price, `amount`; there are no discount fields. - Refund a payment with `POST /api/payments/{paymentReference}/refunds` (scope `payments:refund`): omit `amount` to refund everything left, send an `Idempotency-Key` so a retry never refunds twice, and treat `pending` as money possibly already returned. Every refund waits until its `cancelableUntil` (4 hours) before it is sent and can be canceled until then with `DELETE /api/payments/{paymentReference}/refunds/{refundId}`. - Read what happened to a payment with `GET /api/payments/{paymentReference}/timeline` (every step, oldest first) and list payments with `GET /api/payments/timeline` (newest first; pass `continuationToken` back unchanged for the next page), scope `internet:read`. The timeline can trail real time by seconds: decide on the payment read, never on the timeline. - Make a payment link with `POST /api/payments/payment-links` (scope `payment-links:create`; read with `GET` and `GET /api/payments/payment-links/{id}` under `payment-links:read`, cancel with `DELETE` under `payment-links:create`): a single-use link for a fixed amount, sent to the shopper at its `url`. A partner's key makes test links only. - Make a personal registration link with `POST /api/partners/registration-links` (scope `registration-links:manage`, held by the live key a live partner makes for itself, never by a merchant's key or a test key). A return to its address is not proof of signup: read the link's `status`. - Send an `Idempotency-Key` (generated once per checkout attempt, stored with the order) on every create: a retry with the same key and body returns the first payment instead of opening a second one; a `409` `idempotency_key_in_use` means the first call is still running (retry it unchanged), `idempotency_key_expired` means create a new payment with a new key. - Webhooks are at-least-once. Answer `2xx` only after verifying the signature and either processing the webhook or storing it durably (an inbox keyed on `X-Mps-Delivery-Id`); never start work after answering that a crash could lose. Confirm by reading the payment, and settle each order with an update that only succeeds once. - The API key belongs on your backend only — never in a browser, a mobile app or a POS front end. - `payment.received` carries `status` `completed`; decide on the payment read's `state` (`executed` = paid), never on the webhook body. Requirements for any checkout, including one built by an AI app builder (Lovable, Bolt, v0) — the code per platform and the tests are in [Build an app with a vibe-coding platform](https://docs.mps-emi.com/llms.mdx/docs/build-with-ai/vibe-coding/content.md): 1. Server side only: the API key, the signing secret and every call to MPS live on the server, in the server functions the project already has (TanStack Start server functions, Supabase Edge Functions, Next.js route handlers, ...). The gateway answers no browser (CORS) requests. 2. Price and order on the server: compute the total in cents on the server, save the order, create the payment with an `Idempotency-Key` stored with the order; a retry reuses key and body. After `failed` or `abandoned`, a new payment takes a new key; while one is `pending`, reopen its `checkoutUrl`. Build `successUrl` and `failureUrl` from the origin of the request that creates the payment (forwarded headers, else the request URL): never ask the user for the app's address and never hardcode a preview or `*.lovable.app` host. `callbackUrl` is the server's own webhook route, a public https address; leave it out on localhost. 3. Never show the checkout in a frame (`frame-ancestors 'none'`); an app builder's preview is a frame, where it is a gray screen. Standalone, navigate the page to `checkoutUrl`; framed (`window.self !== window.top`), call `window.open("about:blank")` in the click handler before any await and point that tab at `checkoutUrl`. Always also show a link, a copy-link button and the address: some mobile hosts swallow the tab. On a failed create, close the reserved tab and show a retryable error. 4. Paid means read and checked on the server: mark the order paid only when GET /api/payments/internet/{paymentReference} says `state` `executed` and `amount`, `currency` and `reference` match the order, with an update that only succeeds once. A declined card is `failed`; keep the order open, because in live mode a late ANNA bank payment can still turn `failed` or `abandoned` into `executed` and send `payment.received`. `pending` after the failure URL means the shopper went back to the shop and can still pay. 5. Signed webhook: verify HMAC-SHA256(signing secret, timestamp + "." + raw body) with Web Crypto in Deno/edge runtimes, settle as the return page does; the same webhook can arrive twice. 6. Done means tested with a test key: paid (4111 1111 1111 1111), declined (4000 0000 0000 0002), pending (4000 0000 0000 0010), back to the shop then paid, a retried create, a duplicate webhook, a wrong signature, and the checkout opening both in the preview and in the published app. ## Docs ### Get started - [Online payments with MPS](https://docs.mps-emi.com/llms.mdx/docs/content.md): Choose how you take online payments with MPS, from a payment link without code to an integration your developer builds. - [Set up your account for online payments](https://docs.mps-emi.com/llms.mdx/docs/set-up-your-account/content.md): Check that your MPS platform access has the Online module, and learn what test payments and live payments each need. - [Switch to live payments](https://docs.mps-emi.com/llms.mdx/docs/take-live-payments/content.md): Move from test mode to real payments with a payment link, a shop plugin or your own integration, and check what to do before the first one. ### Without code - [Send a payment link](https://docs.mps-emi.com/llms.mdx/docs/payment-links/content.md): Create a payment link on the MPS platform, share it, and see when it is paid, without writing code. ### Shop plugins - [Connect your webshop](https://docs.mps-emi.com/llms.mdx/docs/connect-your-webshop/content.md): Choose your shop system, install the MPS plugin, take a test order and go live, without writing code of your own. - [Accept payments in WooCommerce](https://docs.mps-emi.com/llms.mdx/docs/woocommerce/content.md): Install the MPS Payments plugin, paste your API key, and take MPS payments in a WooCommerce shop without writing code. - [Accept payments in Odoo](https://docs.mps-emi.com/llms.mdx/docs/odoo/content.md): Install the MPS payment provider, paste your API key, and take MPS payments in Odoo without writing code. - [Accept payments in Magento](https://docs.mps-emi.com/llms.mdx/docs/magento/content.md): Install the MPS Payments module on your Magento server, paste your API key, and take MPS payments without writing code of your own. - [Accept payments in PrestaShop](https://docs.mps-emi.com/llms.mdx/docs/prestashop/content.md): Install the MPS Payments module, paste your API key, and take MPS payments in a PrestaShop shop without writing code. - [Accept payments in Drupal Commerce](https://docs.mps-emi.com/llms.mdx/docs/drupal/content.md): Install the Commerce MPS module on your Drupal server, paste your API key, and take MPS payments without writing code of your own. - [Accept payments on a Wix site](https://docs.mps-emi.com/llms.mdx/docs/wix/content.md): Copy the MPS files into your Premium Wix site, save your API key in the Secrets Manager, and take MPS payments at the Wix checkout. - [Build with AI](https://docs.mps-emi.com/llms.mdx/docs/build-with-ai/content.md): Choose the AI tool you build with, and follow its page with the ready-made prompt and the test checklist. - [Build an app with a vibe-coding platform](https://docs.mps-emi.com/llms.mdx/docs/build-with-ai/vibe-coding/content.md): Paste one prompt into Lovable, Bolt, v0 or a similar platform and get a shop that creates, opens and confirms MPS payments from its server side. - [Build with an AI coding assistant](https://docs.mps-emi.com/llms.mdx/docs/build-with-ai/coding-assistant/content.md): Point Cursor, Claude Code, Copilot or Codex at the MPS documentation and a ready-made prompt, then check what it wrote before you go live. - [Ask a chat assistant](https://docs.mps-emi.com/llms.mdx/docs/build-with-ai/chat-assistant/content.md): Give ChatGPT, Claude, Gemini or your own agent one MPS page or the whole documentation as Markdown, so its answers follow the real contract. ### Build an integration - [Take your first online payment](https://docs.mps-emi.com/llms.mdx/docs/quickstart/content.md): Create a test payment from a terminal, pay it on the MPS checkout and read it back in five minutes, with one test key. - [Accept a payment](https://docs.mps-emi.com/llms.mdx/docs/online-payments/content.md): Create an online payment, send the shopper to the MPS checkout, and read the outcome when they come back. - [Receive webhooks](https://docs.mps-emi.com/llms.mdx/docs/webhooks/content.md): Receive the webhooks MPS sends to your callbackUrl, verify each one, and process it once, with the delivery and retry rules MPS applies. - [Payment lifecycle](https://docs.mps-emi.com/llms.mdx/docs/payment-lifecycle/content.md): The states an online payment moves through, how the checkout redirect, the webhook and the read fit together, and what to do with each outcome. - [Authentication](https://docs.mps-emi.com/llms.mdx/docs/authentication/content.md): Your backend sends its MPS API key in the Authorization header of every call. - [Concepts](https://docs.mps-emi.com/llms.mdx/docs/concepts/content.md): The keys, wallets, identifiers and payment states every page of these docs refers to, explained in one place. - [Run an integration example](https://docs.mps-emi.com/llms.mdx/docs/integration-examples/content.md): Run a minimal example or a production starting point in C#, TypeScript, Python or PHP that creates payments, verifies and stores webhooks and settles orders, to which you add durable fulfilment and reconciliation before a live shop uses it. - [Refund a payment](https://docs.mps-emi.com/llms.mdx/docs/refunds/content.md): Refund an online payment in full or in part, as many times as you need, without ever refunding more than was paid. - [Follow a payment's timeline](https://docs.mps-emi.com/llms.mdx/docs/payment-timeline/content.md): Read every step a payment went through, and list your payments with their current state, to explain a result to a shopper or your support team. - [Create a payment link with the API](https://docs.mps-emi.com/llms.mdx/docs/payment-links-api/content.md): 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. - [Create a registration link](https://docs.mps-emi.com/llms.mdx/docs/registration-links/content.md): Send a company to MPS's signup with a personal registration link, as a live partner, and follow whether it was used. - [Production checklist](https://docs.mps-emi.com/llms.mdx/docs/production-checklist/content.md): What to check before you switch to a live key, each check linking to the page that explains it. ### Reference - [API reference](https://docs.mps-emi.com/llms.mdx/docs/api-reference/content.md): Every public endpoint with its parameters, request and response schemas and code samples, generated from the gateway's OpenAPI document. - [Get a payment link](https://docs.mps-emi.com/llms.mdx/docs/api-reference/payment-links/payment-links-get/content.md): Reads one payment link of the key's merchant. Answers 404 for a link of another merchant, the same answer as for a link that does not exist. - [Cancel a payment link](https://docs.mps-emi.com/llms.mdx/docs/api-reference/payment-links/payment-links-cancel/content.md): Stops an open payment link opening payments. Canceling a canceled link answers 204 again. Answers 409 with code payment_link_not_open once the link is paid or expired: a payment already on its checkout can still be paid, and a paid link stays paid. Answers 404 for a link of another merchant. - [List payment links](https://docs.mps-emi.com/llms.mdx/docs/api-reference/payment-links/payment-links-list/content.md): Lists the payment links of the key's merchant, newest first. Reads count toward the 100 requests a minute. - [Create a payment link](https://docs.mps-emi.com/llms.mdx/docs/api-reference/payment-links/payment-links-create/content.md): Makes a single-use payment link for a fixed amount and returns the address to send the shopper to. The link is test or live as the key is: a test key makes test links, a live key makes live links. A partner's key makes test links only, and a link with no shop name on record is a 409 naming payment_link_unnamed. A link stops opening payments once it is paid, canceled or expired. - [Create an online payment](https://docs.mps-emi.com/llms.mdx/docs/api-reference/online-payments/payments-internet-create/content.md): Opens an online payment and returns the page to send the shopper to. Every call opens a new payment unless it carries an Idempotency-Key (or X-Idempotency-Key): a retry with the same key and the same body returns the payment the first call made, for 24 hours. The same key with a different body is a 400 naming Idempotency-Key; a retry while the first call is still running is a 409. - [Get an online payment](https://docs.mps-emi.com/llms.mdx/docs/api-reference/online-payments/payments-internet-get/content.md): Reports a payment's outcome from stored state. Reads count toward the 100 requests a minute; poll at most every 2 seconds. Answers 404 for a reference not found for the API key's wallet. - [Get a payment's timeline](https://docs.mps-emi.com/llms.mdx/docs/api-reference/online-payments/payments-timeline-get/content.md): Returns one payment's current state and every step it went through, oldest first. Answers 404 for a reference not found for the key's wallet, or of the other mode (a test payment read with a live key, and the reverse). - [List payment timeline](https://docs.mps-emi.com/llms.mdx/docs/api-reference/online-payments/payments-timeline-list/content.md): Lists the merchant's payments, newest first, one page at a time, each with its current state and no steps. Pass the continuationToken from a page, unchanged, to read the next; it is left out on the last page. Any other value is a 400 naming continuationToken. The timeline can trail real time by a few seconds, so it is not the source of truth for a payment's status: read the payment for that. - [Get a refund](https://docs.mps-emi.com/llms.mdx/docs/api-reference/refunds/payments-refunds-get/content.md): Reads one refund of the payment, by the id returned when it was requested. Answers 404 for a refund of another payment, or of another merchant's. - [Cancel a refund](https://docs.mps-emi.com/llms.mdx/docs/api-reference/refunds/payments-refunds-cancel/content.md): Cancels a refund of the payment that has not been sent yet. Every refund waits until its cancelableUntil (4 hours) before it is sent, and can be canceled until then; it then reads canceled, and its amount can be refunded again. Answers 204 when canceled (also for a refund canceled before), 409 once it can no longer be canceled (after cancelableUntil, or once decided) or while other refunds of the payment are being changed (try again), and 404 for a refund of another payment, or of another merchant's. - [List a payment's refunds](https://docs.mps-emi.com/llms.mdx/docs/api-reference/refunds/payments-refunds-list/content.md): Lists the refunds of the payment, oldest first. Answers 404 for a payment belonging to another merchant. - [Refund a payment](https://docs.mps-emi.com/llms.mdx/docs/api-reference/refunds/payments-refunds-create/content.md): Refunds the payment in full or in part, as many times as needed until the paid amount is used up. Omit the amount to refund everything still refundable. Send an Idempotency-Key header so a retry returns the first refund instead of making a second. Answers 404 rather than 403 for a payment belonging to another merchant, and 409 for a payment not yet executed. A refund is answered pending and waits 4 hours (cancelableUntil) before it is sent; it can be canceled until then. In rare cases the 201 already reads failed, with failureReason unknown: it could not be scheduled, nothing is refunded, and the amount can be refunded again with a new Idempotency-Key. Decide on status. - [List registration links](https://docs.mps-emi.com/llms.mdx/docs/api-reference/registration-links/registration-links-list/content.md): Lists the partner's personal registration links, newest first. Filter with status: open, used, completed, expired or revoked. Reads count toward the 100 requests a minute. - [Create a registration link](https://docs.mps-emi.com/llms.mdx/docs/api-reference/registration-links/registration-links-create/content.md): Makes a personal registration link for one company and one e-mail address: it sends that company to the MPS signup. The link's url is the address the company opens to sign up: send it to the company. The company is looked up in the register when the register answers, and the link is made either way. A return to the return address is not proof that the company signed up: read the link's status. - [Get a registration link](https://docs.mps-emi.com/llms.mdx/docs/api-reference/registration-links/registration-links-get/content.md): Reads one personal registration link of the partner. Answers 404 for another partner's link, the same answer as for a link that does not exist. - [Revoke a registration link](https://docs.mps-emi.com/llms.mdx/docs/api-reference/registration-links/registration-links-revoke/content.md): Revokes a personal registration link nobody has signed up with yet. Answers 409 once somebody has signed up with it. Answers 404 for another partner's link. - [Errors and rate limits](https://docs.mps-emi.com/llms.mdx/docs/errors-and-rate-limits/content.md): Every status code the API answers, its error body, the rate limits and the retry policy, with what to do about each one. - [Overview](https://docs.mps-emi.com/llms.mdx/docs/overview/content.md): What the MPS payment gateway is, the host you talk to, and the shape of every integration. - [Changelog](https://docs.mps-emi.com/llms.mdx/docs/changelog/content.md): Changes to what the API, the webhooks and test mode do, newest first, with every change an existing integration has to act on marked Breaking. ## Optional - [Full documentation in one file](https://docs.mps-emi.com/llms-full.txt): every page above, concatenated. - [OpenAPI document](https://docs.mps-emi.com/openapi.json): the exact request and response schemas of every public endpoint, for generating an API client.