Cancel payment refund

Refunds API v2
DELETEhttps://api.mollie.com/v2/payments/*paymentId*/refunds/*id*

For certain payment methods, like iDEAL, the underlying banking system will delay refunds until the next day. Until that time, refunds may be canceled manually in the Mollie Dashboard, or programmatically by using this endpoint.

A refund can only be canceled while its status field is either queued or pending. See the Get refund endpoint for more information.

Parameters

Replace paymentId in the endpoint URL by the payment’s ID, and replace id by the refund’s ID. For example: /v2/payments/tr_7UhSN1zuXS/refunds/re_4qqhO89gsT.

Access token parameters

If you are using organization access tokens or are creating an OAuth app, you can enable test mode through the testmode parameter.

testmodebooleanoptional

Response

204 No Content

Example

cURLPHPPythonRubyNode.js
1
2
curl -X DELETE https://api.mollie.com/v2/payments/tr_WDqYK6vllg/refunds/re_4qqhO89gsT \
      -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"
1
2
3
4
5
6
<?php
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");

$refund = $mollie->payments->get("tr_WDqYK6vllg")->getRefund("re_4qqhO89gsT");
$refund->cancel();
1
2
3
4
5
6
7
from mollie.api.client import Client

mollie_client = Client()
mollie_client.set_api_key("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM")

payment = mollie_client.payments.get("tr_WDqYK6vllg")
payment.refunds.delete("re_4qqhO89gsT")
1
2
3
4
5
6
const { createMollieClient } = require('@mollie/api-client');
const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });

await mollieClient.paymentRefunds.cancel('re_4qqhO89gsT', {
  paymentId: 'tr_WDqYK6vllg'
});
1
2
3
4
We don't have a Ruby code example for this API call yet.

If you have some time to spare, feel free to share suggestions on our Discord:
https://discord.gg/VaTVkXB4aQ

Response

1
HTTP/1.1 204 No Content