Use payment line items for flexible paymentsPublic preview
Learn how to use payment line items with complex payments, such as multicapture and overcapture payments.
You can use payment line items for complex payments, such as multicapture and overcapture payments.
Multicapture
You can use payment line items during multicaptures.
Note
Multicapture isn’t supported for Klarna or PayPal.
Create and confirm an uncaptured PaymentIntent
Note
The API response doesn’t include line items by default. To return line items, expand amount_
.
Specify the capture_
as manual
when creating the PaymentIntent and use the if_
parameter to request multicapture for this payment. The created PaymentIntent allows multiple captures if the payment method supports it.
In the response, the amount_
field contains the line items specified on the PaymentIntent.
Capture the PaymentIntent
- You can add
amount_
on the first capture even if they weren’t specified at creation.details - If you provided
amount_
at creation, you must either pass indetails amount_
or unset them on the first capture.details
The same rules apply to amount_
– you can add them on the first capture if not specified at creation, but must include or explicitly unset them if they were present at creation.
In the response, the amount_
field contains the line items specified on the first capture.
The PaymentIntent remains in a requires_
state. At this point, you can either:
- Continue to capture the PaymentIntent multiple times up to the full amount of the PaymentIntent.
- Transition the PaymentIntent to a
succeeded
state by settingfinal_
tocapture true
, or making a capture without thefinal_
parameter (becausecapture final_
defaults tocapture true
).
Overcapture
You can use payment line items during overcaptures.
Create and confirm an uncaptured PaymentIntent
Note
The API response doesn’t include line items by default. To return line items, expand amount_
.
Specify the capture_
as manual
when creating the PaymentIntent and use the if_
parameter to request overcapture for this payment. The created PaymentIntent allows overcapture if the payment method supports it.
In the response, the amount_
field contains the line items specified on the PaymentIntent.
Capture the PaymentIntent
To capture more than the currently authorised amount on a PaymentIntent, use the capture endpoint and provide an amount_to_capture up to the maximum_amount_capturable.
Pass in an updated amount_
hash that is consistent with the capture amount during Capture.
In the response, the amount_
field contains the line items specified during capture.
Incremental authorisation
You can use payment line items during incremental authorisation to authorise additional amounts on a PaymentIntent after the initial authorisation.
Create and confirm an uncaptured PaymentIntent
Note
The API response doesn’t include line items by default. To return line items, expand amount_
.
Specify the capture_
as manual
when creating the PaymentIntent and use the if_
parameter to request incremental authorisation for this payment. The created PaymentIntent allows incremental authorisation if the payment method supports it.
In the response, the amount_
field contains the line items specified on the PaymentIntent.
Increment the authorisation
To authorise additional amounts on a PaymentIntent beyond the initially authorised amount, use the increment_authorisation endpoint and provide an amount up to the maximum incremental authorisation amount supported by the payment method.
Pass in an updated amount_
hash that is consistent with the total authorised amount after the increment.
In the response, the amount_
field contains the line items specified during the increment authorisation and the PaymentIntent’s total authorised amount is updated.