Skip to main content

Cancel Payment Intent

POST 

/payment_intents/:id/cancel

Cancel a payment intent that has not been used, so its client secret can no longer create a payment.

Use it when the customer abandons checkout, or when your backend decides the order should not be paid after all.

Only an intent that is still created and unexpired can be canceled. An intent that is already fulfilled, canceled, or expired returns intent_not_cancelable; an expired intent needs no cancellation, as it is already unusable.

No request body is needed.

Request​

Path Parameters

    id uuidrequired

    ID of the payment intent to cancel.

Responses​

Successful operation

Schema

    id uuidrequired

    Unique identifier of the payment intent.

    amount Amount (integer)required

    Possible values: >= 100

    A positive integer representing the payment amount in the smallest currency unit.

    Examples:

    • 1.00 SAR = 100
    • 1.00 KWD = 1000
    • 1 JPY = 1
    currency Currency (string)required

    ISO-4217 three-letter currency code.

    description stringnullable
    callback_url urinullable
    status PaymentIntentStatus (string)required

    Possible values: [created, fulfilled, canceled]

    The intent's own lifecycle, not the payment's outcome.

    • created — awaiting fulfillment. Fulfillable until expires_at passes.
    • fulfilled — the intent was used to create a payment. Whether that payment was approved or declined is tracked on the payment, not here.
    • canceled — canceled before use; the client_secret no longer works.

    Expiry is not a status. An intent past its expires_at stays created but can no longer be fulfilled or canceled.

    client_secret ClientSecret (string)required

    Possible values: Value must match regular expression ^pi_secret_

    Single-use token that authorizes fulfillment of this intent. Pass it to your frontend and treat it as a credential — it is all a browser needs, alongside your publishable key, to create this one payment.

    expires_at date-timerequired

    Fulfillment deadline. Set automatically to one hour after creation.

    fulfilled_at date-timenullable

    Date and time when the intent was fulfilled. null until then.

    created_at date-timerequired
Loading...