Create a payment void
How to create a payment void via API
To create a new payment void, send a POST request to the /api/2026-05/payment_voids endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/2026-05/payment_voids
Arguments
Body Parameter
Type
Required
type
string
Required
attributes._internal_version
string
Optional
attributes.options
object
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
relationships.payment_session
object
Required
relationships.payment_authorization
object
Required
Example
The following request creates a new payment void:
curl -g -X POST \
'https://yourdomain.commercelayer.io/api/2026-05/payment_voids' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "payment_voids",
"relationships": {
"payment_session": {
"data": {
"type": "payment_sessions",
"id": "ABCRtyUpBa"
}
},
"payment_authorization": {
"data": {
"type": "payment_authorizations",
"id": "BCDRtyUpBa"
}
}
}
}
}'On success, the API responds with a 201 Created status code, returning the created resource object:
Last updated