Skip to main content

Retrieve a Setup Intent

Retrieve a Setup Intent resource by ID.

A Setup Intent can be retrieved from the client side using a public API key when the client_secret is passed via query string. Getting the setup intent from the client side is normally done through our client-side library called PayRexJS. If you will retrieve the setup intent from our backend, you can use the secret API key without passing the client secret.

Fetching the Setup Intent using the secret API key from the backend returns more sensitive information than retrieving it from the client side. The attributes returned from the client side via the public API contain the information needed to complete a payment.


Endpoint

GET /setup_intents/:id

Sample code

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

const setupIntent = await client.setupIntents.retrieve('<ID of a setup intent resource>');

Parameters

client_secret REQUIRED IF YOU USE A PUBLIC KEY.

The client secret of the Setup Intent. This attribute is required if you authenticate with the endpoint using your public key. This endpoint is used by PayRexJS using the public key.

Returns

Returns a Setup Intent resource.