Update an authorization
How to update an existing authorization via API
To update an existing authorization, send a PATCH
request to the /api/authorizations/:id
endpoint, where id
is the ID of the resource that you want to update.
Here below the list of all the possible arguments that you can pass with the request body.
Request
PATCH https://yourdomain.commercelayer.io/api/authorizations/:id
Arguments
type
string
Required
id
string
Required
attributes.succeeded
boolean
Optional
attributes._forward
boolean
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
attributes._capture
boolean
Optional
attributes._capture_amount_cents
integer
Optional
attributes._void
boolean
Optional
attributes._cancel
boolean
Optional
Example
The following request updates the authorization identified by the ID "XAyRWNUzyN":
curl -g -X PATCH \
'https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "authorizations",
"id": "xYZkjABcde",
"attributes": {
"_capture": true,
"_capture_amount_cents": 500
}
}
}'
Last updated