List order refunds¶
Orders API v2
GET
https://api.mollie.com/v2/order/*orderId*/refunds
Authentication:API keysOrganization access tokensApp access tokens
Retrieve a list of all refunds made for a specific order.
The results are paginated. See pagination for more information.
Parameters¶
Replace orderId
in the endpoint URL by the order’s ID, for example ord_pbjz8x
.
from
stringoptional
Used for pagination. Offset the result set to the refund with this ID. The refund with
this ID is included in the result set as well.
limit
integeroptional
The number of refunds to return (with a maximum of 250).
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.
Set this to
true
to list test mode order refunds.Response¶
200
application/hal+json
count
integer
The number of refunds found in
_embedded
, which is either the requested number (with a maximum of 250) or the
default number._embedded
objectThe object containing the queried data.
refunds
array
An array of refund objects as described in Get payment refund.
_links
objectLinks to help navigate through the lists of refunds. Every URL object will contain an href
and a type
field.
self
object
The URL to the current set of refunds.
previous
object
The previous set of refunds, if available.
next
object
The next set of refunds, if available.
documentation
object
The URL to the List order refunds endpoint documentation.
Example¶
cURLPHPPythonRubyNode.js
1 2 | curl -X GET https://api.mollie.com/v2/orders/ord_pbjz8x/refunds \ -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" |
1 2 3 4 5 6 | <?php $mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"); $order = $mollie->orders->get("ord_stTC2WHAuS"); $refunds = $order->refunds(); |
1 2 3 4 5 | mollie_client = Client() mollie_client.set_api_key("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM") order = mollie_client.orders.get("ord_stTC2WHAuS") refunds = order.refunds.list() |
1 2 3 4 5 6 7 | require 'mollie-api-ruby' Mollie::Client.configure do |config| config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' end refunds = Order::Refund.all(order_id: 'ord_stTC2WHAuS') |
1 2 3 4 | const { createMollieClient } = require('@mollie/api-client'); const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' }); const refunds = mollieClient.orderRefunds.iterate({ orderId: 'ord_stTC2WHAuS' }); |
Response¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | HTTP/1.1 200 OK Content-Type: application/hal+json { "count": 1, "_embedded": { "refunds": [ { "resource": "refund", "id": "re_4qqhO89gsT", "amount": { "currency": "EUR", "value": "698.00" }, "status": "processing", "createdAt": "2018-03-14T17:09:02.0Z", "description": "Required quantity not in stock, refunding one photo book.", "metadata": { "bookkeeping_id": 12345 }, "paymentId": "tr_WDqYK6vllg", "orderId": "ord_stTC2WHAuS", "lines": [ { "resource": "orderline", "id": "odl_dgtxyl", "orderId": "ord_stTC2WHAuS", "name": "LEGO 42083 Bugatti Chiron", "sku": "5702016116977", "type": "physical", "status": "paid", "metadata": null, "quantity": 1, "unitPrice": { "value": "399.00", "currency": "EUR" }, "vatRate": "21.00", "vatAmount": { "value": "51.89", "currency": "EUR" }, "discountAmount": { "value": "100.00", "currency": "EUR" }, "totalAmount": { "value": "299.00", "currency": "EUR" }, "createdAt": "2018-08-02T09:29:56+00:00", "_links": { "productUrl": { "href": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083", "type": "text/html" }, "imageUrl": { "href": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$", "type": "text/html" } } } ], "_links": { "self": { "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg/refunds/re_4qqhO89gsT", "type": "application/hal+json" }, "payment": { "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg", "type": "application/hal+json" }, "order": { "href": "https://api.mollie.com/v2/orders/ord_stTC2WHAuS", "type": "application/hal+json" }, "documentation": { "href": "https://docs.mollie.com/reference/v2/refunds-api/get-order-refund", "type": "text/html" } } } ] }, "_links": { "self": { "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS/refunds?limit=5", "type": "application/hal+json" }, "previous": null, "next": { "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS/refunds?from=re_APBiGPH2vV&limit=5", "type": "application/hal+json" }, "documentation": { "href": "https://docs.mollie.com/reference/v2/refunds-api/list-order-refunds", "type": "text/html" } } } |