Create a payment refund
How to create a payment refund via API
To create a new payment refund, send a POST request to the /api/2026-05/payment_refunds endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/2026-05/payment_refunds
Arguments
type
string
Required
attributes._internal_version
string
Optional
attributes.amount_cents
integer
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_capture
object
Required
relationships.return
object
Optional
Example
The following request creates a new payment refund:
curl -g -X POST \
'https://yourdomain.commercelayer.io/api/2026-05/payment_refunds' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "payment_refunds",
"relationships": {
"payment_session": {
"data": {
"type": "payment_sessions",
"id": "ABCRtyUpBa"
}
},
"payment_capture": {
"data": {
"type": "payment_captures",
"id": "BCDRtyUpBa"
}
}
}
}
}'On success, the API responds with a 201 Created status code, returning the created resource object:
Last updated