# Concepts (/concepts) > The keys, wallets, identifiers and payment states every page of these docs refers to, explained in one place. ## Keys Every integration authenticates with an **API key**, sent as `Authorization: Bearer` on every call from your backend. What a key can do depends on its kind: > **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. | Kind | Recognised by | Takes payments for | Send `x-wallet-number`? | |---|---|---|---| | **Test key** | Starts with `mps_test_` | Your own wallet, as test payments: nothing is charged, booked or paid out. It does not expire. | No | | **Merchant key** | Starts with `mps_live_`, issued for one merchant | That merchant's wallet | No | | **Partner key** | Starts with `mps_live_`, issued to a partner that onboards merchants | Any merchant the partner onboarded, named per call | Yes, always | You create keys under **Online › API keys** on the MPS platform: as many test keys as you like, and live keys per merchant once that merchant has signed its contract. A key generated on the platform comes with its own webhook **signing secret**, shown once, which signs the webhooks MPS sends to your `callbackUrl`. For a key MPS issued to you directly, ask MPS for one: see [The signing secret](/webhooks#the-signing-secret). The API key and the signing secret can be replaced, never recovered. Keep both on your backend: see [Keep the key on your backend](/authentication#keep-the-key-on-your-backend). ## Wallets and merchants A **wallet** identifies a merchant at MPS, written like `BE0000000000`. Every call acts for exactly one wallet, and every payment it creates is for that wallet. A test key or a merchant key acts for its own wallet and ignores any you send; a partner key names the merchant on every call with `x-wallet-number`. A payment created for one merchant cannot be read as another. See [Choosing the merchant](/authentication#choosing-the-merchant). ## Scopes An API key carries every scope it was issued: | Scope | Allows | |---|---| | `internet:create`, `internet:read` | Creating and reading [online payments](/online-payments) | | `payments:refund` | Refunding a payment, and reading and cancelling its refunds. See [Refunds](/refunds) | | `payment-links:create`, `payment-links:read` | Making, cancelling, listing and reading payment links. See [Create a payment link with the API](/payment-links-api) | | `registration-links:manage` | A live partner's personal registration links. See [Create a registration link](/registration-links) | ## Hosts Your backend calls the API at `https://gateway.mps-emi.com`; the shopper's browser opens the checkout at `https://pay.mps-emi.com`. Test keys and live keys use the same hosts: see [The hosts](/overview#the-hosts). ## Identifiers | Identifier | Where it comes from | What it is for | |---|---|---| | `paymentReference` | Create, and every webhook | The MPS reference of an online payment, and the only key its read accepts. `test-` + a GUID for a test payment. In a webhook it identifies the payment the same way. | | `reference` | You, on create | Your own order reference, shown to the shopper. Echoed back on the read, and as `merchantReference` in the webhook. At most 64 characters: letters, digits, spaces and `. _ : / # + -`. Never a lookup key. | | `Idempotency-Key` | You, on create and on a refund | One value per attempt — a payment's checkout attempt, or one refund — stored before you send it. A retry with the same key and body returns the first result instead of making a second. At most 255 characters: letters, digits and punctuation, no spaces. See [Retrying safely](/online-payments#retrying-safely-idempotency-key). | | `refundId` | Refund create | The refund, and the key Get a refund and Cancel a refund take; also in every refund webhook. | | `paymentId` | The webhook | The booking MPS made for a received payment. | | `traceId` | Every error (problem document) | One call in MPS's logs. Quote it when you contact MPS about a failed call. | | `X-Mps-Delivery-Id` | The webhook headers | One webhook, for logs and support. Every retry of it carries the same value, so it marks a repeat; settle orders by `paymentReference`. | Treat every identifier MPS returns as an opaque string: store it exactly as returned, allow up to 64 characters, and never parse or validate its format. The `Idempotency-Key` is yours, and can be up to 255 characters. ## Payment lifecycle The read answers a `state`: `pending` until it is decided, then `executed` (paid), `failed` or `abandoned` (not paid within 24 hours). Only a late ANNA bank payment turns `failed` or `abandoned` into `executed`. [Payment lifecycle](/payment-lifecycle) explains each one, draws how the states, the redirect and the webhook fit together, and says what to do with each. ### `state`, `status` and the webhook Two fields name an outcome, in three places. They are not interchangeable: | Where | Field | Values | |---|---|---| | Reading a payment | `state` | `pending`, `executed`, `failed`, `abandoned` | | The `payment.received` webhook | `status` | Always `completed`: the payment was received. Reading it then answers `state` `executed`. | | A refund, read or in a refund webhook | `status` | `pending`, `refunded`, `failed`, `canceled` | Decide on the read's `state`. A webhook's `status` tells you which event it is, not what to ship. A state you do not recognise is `pending`, never paid. New states may be added: see the [changelog](/changelog#what-counts-as-non-breaking). ## Related - [Payment lifecycle](/payment-lifecycle): every state, the redirect and the webhook in one diagram - [Authentication](/authentication): keys, choosing the merchant and scopes - [Webhooks](/webhooks): receive and verify webhooks - [Overview](/overview): the hosts and the shape of every integration