Hex Pay Docs
Api

Cancel Payment

Cancel a specific payment (only possible if payment is not processed yet)

DELETE
/v1/payments/{paymentID}/cancel
AuthorizationBearer <token>

JWT token with EdDSA signature. Use Bearer scheme.

In: header

Path Parameters

paymentIDstring

Payment identifier

Response Body

curl -X DELETE "https://api.hexpay.io/v1/payments/019327c6-2058-7901-b234-56789abcdeff/cancel"

{
  "message": "Payment cancelled successfully",
  "paymentID": "019327c6-2058-7901-b234-56789abcdeff"
}

{
  "error": "Payment cannot be cancelled in current status",
  "code": "PAYMENT_NOT_CANCELLABLE"
}

{
  "error": "Invalid authentication token",
  "code": "AUTH_INVALID"
}

{
  "error": "Payment not found",
  "code": "PAYMENT_NOT_FOUND"
}

{
  "error": "Internal server error",
  "code": "INTERNAL_ERROR"
}