palbaseDocs

Palbase Payments · API

POST/payments/intents/{intent_id}/cancel

Cancel payment intent

Cancels an unsettled PaymentIntent, voids any provider authorization, and releases any split wallet hold. What is still open of the payment at its provider — a hosted page its buyer could pay on, a card's charge whose outcome is not known — is closed there before the payment is told canceled (Stripe). An attempt found paid is the payment: it is settled paid and the answer is 409 intent_already_succeeded. 409 payment_busy while a confirmation of the payment is being made; 503 when the provider cannot say how an open attempt stands — the payment is not told canceled while money may be taken on it, and asking again is safe. A channel whose keys the provider refuses, or that cannot be asked at all, withdraws nothing: the payment is canceled all the same. After a 503, what the cancellation had begun to close is closed within minutes and the payment is told failed (payments.payment.failed) — payable again — unless the cancellation is asked again. 409 payment_busy and 409 payment_in_progress are not kept against an Idempotency-Key: asked again under the same key, the cancellation is made.

Called by your server, with the project's secret key.

Path

intent_idstring · requiredPaymentIntent UUID.

Headers

Idempotency-Keystring · optionalUnique client-supplied idempotency key (1-255 chars) ensuring safe retries without duplicate charges, refunds, or ledger movements.

Request body

reasonstring · optionalOptional cancellation reason.
curl
curl -X POST "https://<your-ref>.palbase.studio/payments/intents/<intent_id>/cancel" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"reason":"string"}'

Responses

200OK

defaultStandard Palbase JSON error envelope (`error` and `error_description`).

Operation CancelIntent of payments's contract.