# Create an online payment (/api-reference/online-payments/payments-internet-create) > 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. Requires the `internet:create` scope. `POST https://gateway.mps-emi.com/api/payments/internet/create` ```json { "tags": [ "Online payments" ], "summary": "Create an online payment", "description": "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.\n\nRequires the `internet:create` scope.", "operationId": "payments-internet-create", "parameters": [ { "name": "x-wallet-number", "in": "header", "description": "Only with a partner key, on every call: the wallet of the merchant this call acts for, such as BE0000000000. A test key or a merchant key acts for its own wallet and ignores it.", "schema": { "type": "string" } }, { "name": "Idempotency-Key", "in": "header", "description": "One value per checkout attempt, stored with the order before the call. A retry with the same key and body within 24 hours returns the payment the first call made. Scoped to your merchant and mode.", "schema": { "maxLength": 255, "pattern": "^[!-~]+$", "type": "string" } }, { "name": "X-Idempotency-Key", "in": "header", "description": "The same key under another name, supported alongside Idempotency-Key. Send one of the two; sent together, they must carry the same key.", "schema": { "maxLength": 255, "pattern": "^[!-~]+$", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateInternetPaymentRequest" } } }, "required": true }, "responses": { "200": { "description": "Success.", "headers": { "traceparent": { "description": "The call's W3C trace: 00-{trace id}-{span id}-{flags}. Sent on every answer, a success or a refusal without a body included. Quote it when you contact MPS about the call; its trace id is the one in a problem's traceId.", "schema": { "type": "string" }, "examples": { "default": { "value": "00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01" } } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsePayloadOfCreateInternetPaymentResponse" } } } }, "400": { "description": "Bad Request", "headers": { "traceparent": { "description": "The call's W3C trace: 00-{trace id}-{span id}-{flags}. Sent on every answer, a success or a refusal without a body included. Quote it when you contact MPS about the call; its trace id is the one in a problem's traceId.", "schema": { "type": "string" }, "examples": { "default": { "value": "00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01" } } } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/HttpValidationProblemDetails" } } } }, "401": { "description": "No API key, or a wrong, malformed or revoked one: no body.", "headers": { "WWW-Authenticate": { "description": "Bearer error=\"invalid_token\".", "schema": { "type": "string" } }, "traceparent": { "description": "The call's W3C trace: 00-{trace id}-{span id}-{flags}. Sent on every answer, a success or a refusal without a body included. Quote it when you contact MPS about the call; its trace id is the one in a problem's traceId.", "schema": { "type": "string" }, "examples": { "default": { "value": "00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01" } } } } }, "403": { "description": "The key does not carry the internet:create scope, a partner key sent no x-wallet-number, or the merchant has no shop name registered yet (contact MPS): no body. x-wallet-number names a wallet the key does not cover: the body below, error invalid_request.", "headers": { "traceparent": { "description": "The call's W3C trace: 00-{trace id}-{span id}-{flags}. Sent on every answer, a success or a refusal without a body included. Quote it when you contact MPS about the call; its trace id is the one in a problem's traceId.", "schema": { "type": "string" }, "examples": { "default": { "value": "00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01" } } } }, "content": { "application/json": { "schema": { "required": [ "error", "error_description" ], "type": "object", "properties": { "error": { "type": "string", "description": "invalid_request." }, "error_description": { "type": "string", "description": "Why the wallet was refused, for a person." } }, "examples": [ { "error": "invalid_request", "error_description": "The requested wallet is not covered by this key's account." } ] } } } }, "409": { "description": "A conflict, named by code: idempotency_key_in_use (the first call with this Idempotency-Key is still running: retry it unchanged after a second) or idempotency_key_expired (its payment can no longer be returned: create a new one with a new key).", "headers": { "traceparent": { "description": "The call's W3C trace: 00-{trace id}-{span id}-{flags}. Sent on every answer, a success or a refusal without a body included. Quote it when you contact MPS about the call; its trace id is the one in a problem's traceId.", "schema": { "type": "string" }, "examples": { "default": { "value": "00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01" } } } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ConflictProblem" } } } }, "429": { "description": "Over the 100 requests a minute per API key, shared by every endpoint, or more than 10 failed API keys a minute from your address: no body. Wait the number of seconds in Retry-After, then retry.", "headers": { "Retry-After": { "description": "Seconds to wait before retrying.", "schema": { "type": "integer" } }, "traceparent": { "description": "The call's W3C trace: 00-{trace id}-{span id}-{flags}. Sent on every answer, a success or a refusal without a body included. Quote it when you contact MPS about the call; its trace id is the one in a problem's traceId.", "schema": { "type": "string" }, "examples": { "default": { "value": "00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01" } } } } }, "500": { "description": "A problem on our side, as a problem document with the traceId to quote to MPS. Other 5xx answers can carry no body. Retry a read with backoff; retry a create or refund only with the same Idempotency-Key.", "headers": { "traceparent": { "description": "The call's W3C trace: 00-{trace id}-{span id}-{flags}. Sent on every answer, a success or a refusal without a body included. Quote it when you contact MPS about the call; its trace id is the one in a problem's traceId.", "schema": { "type": "string" }, "examples": { "default": { "value": "00-a27c57cb2b3e4f5d8c9a0b1c2d3e4f50-1a2b3c4d5e6f7a8b-01" } } } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ServerProblem" } } } } }, "callbacks": { "webhook": { "$request.body#/callbackUrl": { "post": { "summary": "Webhook", "description": "Posted to the callbackUrl, server to server, once the payment has been received and booked (payment.received), and when a refund of it ends: refund.refunded (paid out), refund.failed (not paid out; the amount can be refunded again) or refund.canceled (canceled before it was sent). Verify X-Mps-Signature over the raw body before acting on it. Answer 2xx once the webhook is processed or durably stored: anything else, or no answer within 10 seconds, is retried. MPS never follows a redirect: a 3xx counts as failed too. A failed delivery is retried after 1m, 5m, 30m, 2h, 6h, each counted from the previous attempt: 6 attempts in all, then it is not sent again, so reconcile by reading the payment. Delivery is at least once, so key on X-Mps-Delivery-Id. The read endpoints stay authoritative.", "parameters": [ { "name": "X-Mps-Event", "in": "header", "description": "The event type, so you can route without parsing the body.", "required": true, "schema": { "type": "string" }, "examples": { "default": { "value": "payment.received" } } }, { "name": "X-Mps-Timestamp", "in": "header", "description": "Unix seconds. Part of the signed content; reject one more than five minutes from your clock.", "required": true, "schema": { "type": "string" }, "examples": { "default": { "value": "1791892800" } } }, { "name": "X-Mps-Delivery-Id", "in": "header", "description": "Identifies the webhook delivery: every retry of it carries the same value.", "required": true, "schema": { "type": "string" }, "examples": { "default": { "value": "00000000-0000-4000-8000-000000000003" } } }, { "name": "X-Mps-Signature", "in": "header", "description": "v1= followed by the lower-case hex HMAC-SHA256 of {X-Mps-Timestamp}.{raw body} with the signing secret of your API key. During a signing secret rotation it carries two comma-separated values; accept either.", "required": true, "schema": { "type": "string" }, "examples": { "default": { "value": "v1=82b9a79df151e0e9207ef421fe4085e0a0ca95f3047265a0b92701ad5011c326" } } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Webhook" } } }, "required": true }, "responses": { "2XX": { "description": "Processed, or durably stored. Answer within 10 seconds." }, "default": { "description": "Any other answer, or none within 10 seconds, counts as failed and is retried." } }, "security": [ {} ] } } } }, "security": [ { "apiKey": [] } ] } ``` Schemas referenced as `#/components/schemas/…` are defined in the full document at /openapi.json.