Updating the payment intent

How to update the Axerve payment intent amount

Problem

You have created a payment source for Axerve, but you're not sure if the order changed in the meanwhile. You want to update the payment intent with the latest order amount.

Solution

If you want to update the payment intent amount of the Axerve payment, send a PATCH request to the /api/axerve_payments/:id endpoint, setting the _update attribute to true.

Example

The following request updates the Axerve payment source identified by the "ZaDVpIqzeq " ID to refresh its payment intent amount:

curl -g -X PATCH \
  'http://yourdomain.commercelayer.io/api/axerve_payments/ZaDVpIqzeq' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "axerve_payments",
    "id": "ZaDVpIqzeq",
    "attributes": {
      "_update": true
    }
  }
}'

More to read

Last updated