# Refund a payment (/api-reference/refunds/payments-refunds-create) > 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. Requires the `payments:refund` scope. `POST https://gateway.mps-emi.com/api/payments/{paymentReference}/refunds` ```json { "tags": [ "Refunds" ], "summary": "Refund a payment", "description": "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.\n\nRequires the `payments:refund` scope.", "operationId": "payments-refunds-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": "paymentReference", "in": "path", "description": "The paymentReference create returned, exactly as returned.", "required": true, "schema": { "type": "string" }, "examples": { "default": { "value": "00000000-0000-4000-8000-000000000001" } } }, { "name": "Idempotency-Key", "in": "header", "description": "One value per refund you intend. Kept with the refund, per payment, and never expires: the same key on the same payment always returns that refund. Letters, digits and punctuation, no spaces.", "schema": { "maxLength": 255, "pattern": "^[!-~]+$", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefundPaymentRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "headers": { "Location": { "description": "Where the refund is read: /api/payments/{paymentReference}/refunds/{refundId}.", "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" } } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsePayloadOfRefundResponse" }, "examples": { "pending": { "summary": "Waiting its 4 hours, cancelable until cancelableUntil", "value": { "data": { "refundId": "00000000-0000-4000-8000-000000000004", "paymentReference": "00000000-0000-4000-8000-000000000001", "status": "pending", "amount": 500, "currency": "EUR", "reason": "requested_by_customer", "failureReason": null, "cancelableUntil": "2026-10-22T13:14:03.0000000+00:00", "createdAt": "2026-10-22T09:14:03.0000000+00:00" } } }, "failed": { "summary": "Could not be scheduled: nothing is refunded, the amount is free again", "value": { "data": { "refundId": "00000000-0000-4000-8000-000000000004", "paymentReference": "00000000-0000-4000-8000-000000000001", "status": "failed", "amount": 500, "currency": "EUR", "reason": "requested_by_customer", "failureReason": "unknown", "cancelableUntil": null, "createdAt": "2026-10-22T09:14:03.0000000+00:00" } } } } } } }, "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 payments:refund scope, or a partner key sent no x-wallet-number: 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." } ] } } } }, "404": { "description": "No such payment for this merchant (another merchant's payment answers the same), or a test key on a live payment or the reverse. No body.", "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" } } } } }, "409": { "description": "A conflict, named by code: idempotency_key_in_use (the first request with this Idempotency-Key is still running: retry it unchanged after a second), refund_in_progress (another refund of the payment is being changed: retry after a second) or payment_not_refundable (the payment is not executed: do not retry).", "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" } } } } }, "security": [ { "apiKey": [] } ] } ``` Schemas referenced as `#/components/schemas/…` are defined in the full document at /openapi.json.