Update payment¶
PATCH
https://api.mollie.com/v2/payments/*id*
This endpoint can be used to update some details of a created payment.
Parameters¶
For a more in-depth explanation of each parameter, see the Create payment. There are also payment method-specific parameters available, see below.
description
stringoptionalredirectUrl
stringoptionalThe URL your customer will be redirected to after the payment process.
Updating this field is only possible when the payment is not yet finalized.
cancelUrl
stringoptionalThe URL your consumer will be redirected to when the consumer explicitly cancels the payment. If this URL is not
provided, the consumer will be redirected to the redirectUrl
instead — see above.
Updating this field is only possible when the payment is not yet finalized.
webhookUrl
stringoptionalmetadata
mixedoptionalmethod
stringoptionalChange the payment to a different payment method.
Updating this field is only possible when the payment was created without a payment method and is not yet finalized.
locale
stringoptionalxx_XX
format ISO 15897 locale.For digital goods in most jurisdictions, you must apply the VAT rate from your customer’s country. Choose the VAT rates you have used for the order to ensure your customer’s country matches the VAT country.
Use this parameter to restrict the payment methods available to your customer to those from a single country.
If available, the credit card method will still be offered, but only cards from the allowed country are accepted.
The field expects a country code in ISO 3166-1 alpha-2 format, for example NL.
Payment method-specific parameters¶
If you specify the method
parameter, optional parameters may be available for the payment method. If no method is
specified, you can still send the optional parameters and we will apply them when the consumer selects the relevant
payment method.
Bank transfer¶
billingEmail
stringoptionaldueDate
stringoptionalThe date the payment should expire, in YYYY-MM-DD
format.
Updating this field is only possible when the payment is not yet finalized.
Gift cards¶
issuer
stringoptionalSee Payments API.
Updating this field is only possible when the payment is not yet finalized.
iDEAL¶
issuer
stringoptionalSee Payments API.
Updating this field is only possible when the payment is not yet finalized.
KBC/CBC Payment Button¶
issuer
stringoptionalSee Payments API.
Updating this field is only possible when the payment is not yet finalized.
Przelewy24¶
billingEmail
stringoptionalExample¶
1 2 3 4 5 6 | curl -X PATCH https://api.mollie.com/v2/payments/tr_7UhSN1zuXS \ -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" \ -d "description=Order #98765" \ -d "redirectUrl=https://example.org/webshop/order/98765/" \ -d "webhookUrl=https://example.org/webshop/payments/webhook/" \ -d "metadata={\"order_id\": \"98765\"}" |
1 2 3 4 5 6 7 8 9 10 11 | <?php $mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"); $paymentId = "tr_7UhSN1zuXS"; $mollie->payments->update($paymentId, [ "description" => "Order #98765", "redirectUrl" => "https://example.org/webshop/order/98765/", "webhookUrl" => "https://example.org/webshop/payments/webhook/", "metadata" => ["order_id" => "98765"], ]); |
1 2 3 4 5 6 7 8 9 10 11 12 13 | from mollie.api.client import Client mollie_client = Client() mollie_client.set_api_key("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM") payment = mollie_client.payments.update("tr_7UhSN1zuXS", { "description": "Order #98765", "webhookUrl": "https://webshop.example.org/order/98765/", "redirectUrl": "https://webshop.example.org/payments/webhook/", "metadata": { "order_id": "98765", } }) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | require 'mollie-api-ruby' Mollie::Client.configure do |config| config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' end payment = Mollie::Payment.update( 'tr_7UhSN1zuXS', description: 'Order #98765', redirect_url: 'https://example.org/webshop/order/98765/', webhook_url: 'https://example.org/webshop/payments/webhook/', metadata: { order_id: '98765' } ) |
1 2 3 4 | We don't have a Node.js 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 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 | HTTP/1.1 200 OK Content-Type: application/hal+json { "resource": "payment", "id": "tr_7UhSN1zuXS", "mode": "test", "createdAt": "2018-03-20T09:13:37+00:00", "amount": { "value": "10.00", "currency": "EUR" }, "description": "Order #98765", "method": null, "metadata": { "order_id": "98765" }, "status": "open", "isCancelable": false, "expiresAt": "2018-03-20T09:28:37+00:00", "details": null, "profileId": "pfl_QkEhN94Ba", "sequenceType": "oneoff", "redirectUrl": "https://example.org/webshop/order/98765/", "webhookUrl": "https://example.org/webshop/payments/webhook/", "_links": { "self": { "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS", "type": "application/json" }, "checkout": { "href": "https://www.mollie.com/payscreen/select-method/7UhSN1zuXS", "type": "text/html" }, "dashboard": { "href": "https://www.mollie.com/dashboard/org_12345678/payments/tr_7UhSN1zuXS", "type": "text/html" }, "documentation": { "href": "https://docs.mollie.com/reference/v2/payments-api/update-payment", "type": "text/html" } } } |