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 your Mollie account, or automatically by using this endpoint.

The refund can only be canceled while the refund’s status field is either queued or pending. See Get payment refund 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.

Mollie Connect/OAuth parameters

If you’re creating an app with Mollie Connect/OAuth, the testmode parameter is also available.

testmode

boolean
optional
Set this to true to cancel a test mode refund.

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')
mollie_client.payment_refunds.on(payment).delete('re_4qqhO89gsT')
1
2
3
4
5
6
const { createMollieClient } = require('@mollie/api-client');
const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });

(async () => {
  const status = await mollieClient.payments_refunds.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 open a pull request at:
https://github.com/mollie/api-documentation

Response

1
HTTP/1.1 204 No Content