Skip to main content

Cancel a Setup Intent

Cancels a Setup Intent resource. A Setup intent with a status of canceled means your customer cannot proceed saving a payment method through a particular setup intent.

You can only cancel a setup intent with status awaiting_payment_method.


Endpoint

POST /setup_intents/:id/cancel

Sample code

const client = require('payrex-node')('insert your PayRex Secret API key.');

const setupIntent = await client.setupIntents.cancel(
// setup Intent to cancel.
'<ID of a setup intent resource>',
)

Parameters

id REQUIRED

The id of the setup intent to be cancelled.

Returns

Returns a Setup Intent resource.