Skip to main content

Create a Setup Intent

Creates a Setup Intent resource.


Endpoint​

POST /setup_intents

Sample code​

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

const setupIntents = await client.setupIntents.create({
customer_id: '<insert customer id here>',
payment_methods: [
'card',
'gcash',
'maya'
],
});

Parameters​

customer_id REQUIRED

The ID of the customer resource that will be associated with the Setup Intent.


payment_methods optional

The list of payment methods allowed to be processed by the Setup Intent. Possible values are card, gcash, maya.


description optional

An arbitrary string attached to the Setup Intent.


metadata optional

A set of key-value pairs you can attach to the Setup Intent and the resources created by the Setup Intent.

Returns​

Returns a Setup Intent resource.