# Get payment refund Retrieve a single payment refund by its ID and the ID of its parent payment. > 🔑 Access with > > [API key](/reference/authentication) > > [Organization access token with **refunds.read**](/reference/authentication) > > [OAuth access with **refunds.read**](/reference/authentication) # OpenAPI definition ```json { "openapi": "3.1.0", "info": { "title": "Accepting payments", "version": "1.0.0", "license": { "name": "Attribution-NonCommercial-ShareAlike 4.0 International", "identifier": "CC-BY-NC-SA-4.0" } }, "servers": [ { "url": "https://api.mollie.com/v2" } ], "security": [ { "apiKey": [] }, { "organizationAccessToken": [] }, { "oAuth": [] } ], "paths": { "/payments/{paymentId}/refunds/{refundId}": { "parameters": [ { "name": "paymentId", "description": "Provide the ID of the related payment.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^tr_.+$", "example": "tr_5B8cwPMGnU" } }, { "name": "refundId", "description": "Provide the ID of the related refund.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^re_.+$", "example": "re_5B8cwPMGnU" } } ], "get": { "summary": "Get payment refund", "x-speakeasy-name-override": "get", "tags": [ "Refunds API" ], "operationId": "get-refund", "security": [ { "apiKey": [] }, { "organizationAccessToken": [ "refunds.read" ] }, { "oAuth": [ "refunds.read" ] } ], "description": "Retrieve a single payment refund by its ID and the ID of its parent payment.\n\n> 🔑 Access with\n>\n> [API key](/reference/authentication)\n>\n> [Organization access token with **refunds.read**](/reference/authentication)\n>\n> [OAuth access with **refunds.read**](/reference/authentication)", "parameters": [ { "description": "This endpoint allows embedding related API items by appending the following values via the `embed` query string parameter.", "schema": { "type": "string", "enum": [ "payment" ], "x-enumDescriptions": { "payment": "Embed the payment related to this refund." }, "example": "payment" }, "name": "embed", "in": "query" }, { "name": "testmode", "description": "Most API credentials are specifically created for either live mode or test mode. In those cases the `testmode` query parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting the `testmode` query parameter to `true`.\n\nTest entities cannot be retrieved when the endpoint is set to live mode, and vice versa.", "in": "query", "schema": { "type": "boolean", "example": false } } ], "responses": { "200": { "description": "The payment object.", "content": { "application/hal+json": { "schema": { "type": "object", "required": [ "resource", "id", "mode", "amount", "status", "createdAt", "description", "metadata", "_links" ], "properties": { "resource": { "type": "string", "description": "Indicates the response contains a refund object. Will always contain the string `refund` for this endpoint.", "readOnly": true, "example": "refund" }, "id": { "allOf": [ { "type": "string", "pattern": "^re_.+$", "example": "re_5B8cwPMGnU" } ], "description": "The identifier uniquely referring to this refund. Mollie assigns this identifier at refund creation time. Mollie will always refer to the refund by this ID. Example: `re_4qqhO89gsT`.", "readOnly": true }, "mode": { "type": "string", "description": "Whether this entity was created in live mode or in test mode.\n\nPossible values: `live` `test`", "readOnly": true, "example": "live" }, "description": { "type": "string", "description": "The description of the refund that may be shown to your customer, depending on the payment method used.", "maxLength": 255, "example": "Refunding a Chess Board" }, "amount": { "description": "The amount refunded to your customer with this refund. The amount is allowed to be lower than the original payment amount.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "settlementAmount": { "allOf": [ { "type": [ "object", "null" ], "description": "In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } } ], "description": "This optional field will contain the approximate amount that will be deducted from your account balance, converted to the currency your account is settled in.\n\nThe amount is a **negative** amount.\n\nIf the refund is not directly processed by Mollie, for example for PayPal refunds, the settlement amount will be zero.\n\nSince the field contains an estimated amount during refund processing, it may change over time. For example, while the refund is queued the settlement amount is likely not yet available.\n\nTo retrieve accurate settlement amounts we recommend using the [List balance transactions endpoint](list-balance-transactions) instead.", "readOnly": true }, "metadata": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "array", "items": { "type": "string" } }, { "type": "null" } ], "description": "Provide any data you like, for example a string or a JSON object. We will save the data alongside the entity. Whenever you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB." }, "paymentId": { "allOf": [ { "type": "string", "pattern": "^tr_.+$", "example": "tr_5B8cwPMGnU" } ], "description": "The unique identifier of the payment this refund was created for. The full payment object can be retrieved via the payment URL in the `_links` object.", "readOnly": true }, "settlementId": { "type": [ "string", "null" ], "allOf": [ { "type": "string", "pattern": "^stl_.+$", "example": "stl_5B8cwPMGnU" } ], "description": "The identifier referring to the settlement this refund was settled with. This field is omitted if the refund is not settled (yet).", "readOnly": true }, "status": { "allOf": [ { "type": "string", "enum": [ "queued", "pending", "processing", "refunded", "failed", "canceled" ], "example": "queued" } ], "readOnly": true }, "createdAt": { "type": "string", "description": "The entity's date and time of creation, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.", "readOnly": true, "example": "2024-03-20T09:13:37+00:00" }, "externalReference": { "type": "object", "properties": { "type": { "type": "string", "description": "Specifies the reference type\n\nPossible values: `acquirer-reference`", "example": "acquirer-reference" }, "id": { "type": "string", "description": "Unique reference from the payment provider", "example": 123456789012345 } } }, "reverseRouting": { "type": [ "boolean", "null" ], "description": "*This feature is only available to marketplace operators.*\n\nWith Mollie Connect you can charge fees on payments that your app is processing on behalf of other Mollie merchants, by providing the `routing` object during [payment creation](create-payment).\n\nWhen creating refunds for these *routed* payments, by default the full amount is deducted from your balance.\n\nIf you want to pull back the funds that were routed to the connected merchant(s), you can set this parameter to `true` when issuing a full refund.\n\nFor more fine-grained control and for partial refunds, use the `routingReversals` parameter instead.", "writeOnly": true, "example": false }, "routingReversals": { "type": [ "array", "null" ], "description": "*This feature is only available to marketplace operators.*\n\nWhen creating refunds for *routed* payments, by default the full amount is deducted from your balance.\n\nIf you want to pull back funds from the connected merchant(s), you can use this parameter to specify what amount needs to be reversed from which merchant(s).\n\nIf you simply want to fully reverse the routed funds, you can also use the `reverseRouting` parameter instead.", "items": { "type": "object", "properties": { "amount": { "description": "The amount that will be pulled back.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "source": { "type": "object", "description": "Where the funds will be pulled back from.", "properties": { "type": { "allOf": [ { "type": "string", "description": "The type of source. Currently only the source type `organization` is supported.\n\nPossible values: `organization`", "example": "organization" } ], "writeOnly": true }, "organizationId": { "description": "Required for source type `organization`. The ID of the connected organization the funds should be pulled back from.", "type": "string", "pattern": "^org_.+$", "example": "org_1234567" } } } } } }, "testmode": { "type": [ "boolean", "null" ], "description": "Whether to create the entity in test mode or live mode.\n\nMost API credentials are specifically created for either live mode or test mode, in which case this parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting `testmode` to `true`.", "writeOnly": true, "example": false }, "_links": { "type": "object", "description": "An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.", "required": [ "self", "payment", "documentation" ], "properties": { "self": { "type": "object", "description": "In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "payment": { "description": "The API resource URL of the [payment](get-payment) that this refund belongs to.", "type": "object", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "settlement": { "description": "The API resource URL of the [settlement](get-settlement) this refund has been settled with. Not present if not yet settled.", "type": [ "object", "null" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "documentation": { "type": "object", "description": "In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } } }, "readOnly": true } } }, "examples": { "get-refund-200-1": { "summary": "The payment object", "value": { "resource": "refund", "id": "re_4qqhO89gsT", "mode": "live", "description": "Order", "amount": { "currency": "EUR", "value": "5.95" }, "status": "pending", "metadata": "{\"bookkeeping_id\":12345}", "paymentId": "tr_5B8cwPMGnU6qLbRvo7qEZo", "createdAt": "2023-03-14T17:09:02+00:00", "_links": { "self": { "href": "...", "type": "application/hal+json" }, "payment": { "href": "https://api.mollie.com/v2/payments/tr_5B8cwPMGnU6qLbRvo7qEZo", "type": "application/hal+json" }, "documentation": { "href": "...", "type": "text/html" } } } } } } } }, "404": { "description": "No item with this ID exists, or the refund was canceled.", "content": { "application/hal+json": { "schema": { "type": "object", "description": "An error response object.", "required": [ "status", "title", "detail", "_links" ], "properties": { "status": { "type": "integer", "description": "The status code of the error message. This is always the same code as the status code of the HTTP message itself.", "minimum": 400, "maximum": 599, "example": 404 }, "title": { "type": "string", "description": "The HTTP reason phrase of the error. For example, for a `404` error, the `title` will be `Not Found`.", "example": "Not Found" }, "detail": { "type": "string", "description": "A detailed human-readable description of the error that occurred.", "example": "The resource does not exist" }, "field": { "type": "string", "description": "If the error was caused by a value provided by you in a specific field, the `field` property will contain the name of the field that caused the issue.", "example": "description" }, "_links": { "type": "object", "required": [ "documentation" ], "properties": { "documentation": { "type": "object", "description": "The URL to the generic Mollie API error handling guide.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "example": "https://docs.mollie.com/errors" }, "type": { "type": "string", "example": "text/html" } } } } } } }, "example": { "status": 404, "title": "Not Found", "detail": "No entity exists with token 'uct_abcDEFghij123456789'", "_links": { "documentation": { "href": "...", "type": "text/html" } } } } } } }, "x-readme": { "code-samples": [ { "language": "shell", "code": "curl -X GET https://api.mollie.com/v2/payments/tr_5B8cwPMGnU6qLbRvo7qEZo/refunds/re_4qqhO89gsT \\\n -H \"Authorization: Bearer live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\"" }, { "language": "php", "code": "setApiKey(\"live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\");\n\n$refund = $mollie->send(\n new GetPaymentRefundRequest(\n paymentId: \"tr_5B8cwPMGnU6qLbRvo7qEZo\",\n refundId: \"re_4qqhO89gsT\"\n )\n);", "install": "composer require mollie/mollie-api-php" }, { "language": "node", "code": "const { createMollieClient } = require('@mollie/api-client');\nconst mollieClient = createMollieClient({ apiKey: 'live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });\n\nconst refund = await mollieClient.paymentRefunds.get('re_4qqhO89gsT', {\n paymentId: 'tr_5B8cwPMGnU6qLbRvo7qEZo'\n});", "install": "npm install @mollie/api-client" }, { "language": "python", "code": "from mollie.api.client import Client\n\nmollie_client = Client()\nmollie_client.set_api_key(\"live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\")\n\npayment = mollie_client.payments.get(\"tr_5B8cwPMGnU6qLbRvo7qEZo\")\nrefund = payment.refunds.get(\"re_4qqhO89gsT\")", "install": "pip install mollie-api-python" }, { "language": "ruby", "code": "require 'mollie-api-ruby'\n\nMollie::Client.configure do |config|\n config.api_key = 'live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'\nend\n\nrefund = Mollie::Payment::Refund.get(\n 're_4qqhO89gsT',\n payment_id: 'tr_5B8cwPMGnU6qLbRvo7qEZo'\n)", "install": "gem install mollie-api-ruby" } ] } } } }, "components": { "securitySchemes": { "apiKey": { "type": "http", "scheme": "bearer", "x-default": "live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" }, "organizationAccessToken": { "type": "http", "scheme": "bearer", "x-default": "access_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" }, "oAuth": { "type": "oauth2", "flows": { "authorizationCode": { "authorizationUrl": "https://my.mollie.com/oauth2/authorize", "tokenUrl": "https://api.mollie.com/oauth2/tokens", "scopes": {} } } } } }, "x-readme": { "explorer-enabled": false, "samples-languages": [ "shell", "php", "node", "python", "ruby" ] } } ```