Skip to main content

Capture a PaymentIntent

Captures a PaymentIntent resource.


Endpoint

POST /payment_intents/:id/capture

Sample code

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

const paymentIntent = await client.paymentIntents.capture(
// Payment Intent to capture.
'pi_1234',
{
// Amount is in cents. The sample below is 100.00.
amount: 10000,
}
)

Parameters

id REQUIRED

The id of the PaymentIntent to be captured.


amount REQUIRED

The amount to be collected by the PaymentIntent. This is a positive integer that your customer will pay in the smallest currency unit, cents. If the customer should pay for ₱ 120.50, the amount of the PaymentIntent should be 12050.

The minimum amount is ₱ 20 (2000 in cents) and the maximum amount is ₱ 59,999,999.99 (5999999999 in cents).


Returns

Returns a PaymentIntent resource.