Skip to content

Mark a payment failed, cancelled or expired

POST
/payments/fail
curl --request POST \
--url https://hub.stablezact.com/api/v1/payments/fail \
--header 'Content-Type: application/json' \
--header 'X-Public-Key: <X-Public-Key>' \
--data '{ "paymentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "status": "failed", "reason": "example" }'

Closes a payment the customer will not complete. This records the outcome; it does not move money.

Media typeapplication/json
object
paymentId
required
string format: uuid
status

Anything outside these three is silently treated as failed rather than rejected.

string
default: failed
Allowed values: failed cancelled expired
reason
string

Recorded.

Media typeapplication/json
object
success
boolean
message
string
status
string
skipped

True when the payment was already in a final state, so nothing changed. Not an error.

boolean
Examplegenerated
{
"success": true,
"message": "example",
"status": "example",
"skipped": true
}

Missing or invalid credentials.

Media typeapplication/json
object
success
boolean
error
required

Short machine-ish reason.

string
message

Longer explanation, when there is one.

string
Example
{
"error": "API credentials required. Use x-public-key header or x-api-key and x-api-secret headers."
}