Skip to main content

Edit payment method

This API can currently only be used to convert a service invoice to an advance invoice. The invoice needs to be uncaptured for a conversion to be successful. The advance invoice will be sent instantly to the customer by email. An entry in the availableActions array in the uncaptured suborder chunk will reveal if editPaymentMethod is available. It 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-915b-472b-b5f0-81945bff9e4a' \
-d '{
"paymentMethod": {
"provider": "ledyer",
"type": "advanceInvoice"
}
}'
https://api.sandbox.ledyer.com/v1/orders/:orderId/paymentmethod

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

orderId

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

Request body

paymentMethod

object

An object consisting of the properties paymentMethod and provider. The only payment method available currently is advanceInvoice and the only provider is ledyer.