Skip to main content

Refund order (full)

This request will create a credit invoice with all order lines belonging to the ledgerId parameter of the request. An order must have a captured array populated with order lines for a refund to be successful, that is where the ledgerId string is located. Whether the refund action is available on the order or not, can be determined by inspecting the availableActions array on the suborder chunk. This can be retrieved from the GET order response.

curl -X POST \
-H 'authorization: Bearer v4.public.eyJpc3MiOiJs...' \
-H 'content-type: application/json' \
-H 'Idempotency-Key: da7ca8f9-9155-4721-b5f0-81945bff9e4a' \
https://api.sandbox.ledyer.com/v1/orders/:orderId/refund/:ledgerId

Request Headers

Idempotency-Key

stringOptional

By providing a unique value for this header, the idempotency of the operation will be guaranteed. This means that retries of requests will be safe to apply in case of network errors, socket errors and timeouts, etc. We recommend using UUID version 4 for the key.

Path parameters

ledgerId

The ledger ID string that is included in a capture.

orderId

The order ID string that was obtained when the order session was created.

Request body

note

stringOptional

A note for the refund reason.