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.
'<ID of a payment intent resource>',
{
// 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 captured by the PaymentIntent. This is a positive integer that your customer authorized in the smallest currency unit, cents. If the customer should pay ₱ 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).

This attribute is best used for hold then capture feature of the card payment method.


Returns

Returns a PaymentIntent resource.