Back to reference
POST/payments/{paymentUuid}/cancel
Payments

Cancel payment

Cancels a payment when its current state permits cancellation.

Access tierauthenticatedRate limitpay_apiIdempotencyheader:Idempotency-KeyAuthenticationBearerAuth
SourceLuxApi/Modules/PayAPI/Controllers/PaymentController.php::cancelLuxPayProjects @ 146e98baa44e

Parameters

X-Request-IDheader
stringOptional

Client correlation identifier. LuxPay may generate one when omitted.

Example: req_01J...
paymentUuidpath
stringRequired

Payment UUID.

Example: cf1b7e8e-5bba-4ddb-b2e4-6f4a10d24857
Idempotency-Keyheader
stringRequired

Unique key for safely retrying this mutation. Reuse only for the same logical request.

Example: pay_01JABC...

Code examples

The displayed sandbox host is a placeholder until an official host is provisioned. Never paste a production token into a public browser.
curl --request POST \
  --url 'https://sandbox-api.luxpay.example/v1/payments/cf1b7e8e-5bba-4ddb-b2e4-6f4a10d24857/cancel' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <token>' \
  --header 'Idempotency-Key: pay_01JABC...'

Responses

200Successful response.
success
boolean
Example: true
data
PaymentResult
{
  "success": true,
  "data": {
    "success": false,
    "transaction_id": "string",
    "status": "string",
    "provider": "string",
    "provider_ref": "string",
    "amount": 1,
    "currency": "string",
    "fee_amount": 1,
    "net_amount": 1,
    "message": "string",
    "error_code": "string",
    "is_duplicate": false,
    "metadata": {}
  }
}
400
401
403
404
409
422
429
500
OpenAPI JSONOpenAPI YAMLPostman collection