POST /user/invoices/{invoice_id}/payment-session/confirm
Settle a headless payment the buyer has approved in your own integration. You must call this for any payment session where the settlement value is sync_confirm.
Behavior varies for each payment gateway:
- PayPal confirmation captures the approved order. If you skip it, the buyer's approval expires uncaptured, no payment occurs, and no webhook recovers it.
- Stripe confirmation records payment that has already occurred. If you skip it, the charge.succeeded webhook settles the payment.
The payment.status value has four outcomes:
- paid — The gateway accepted the payment.
- pending — The gateway took the payment but has not settled it (a PayPal PENDING capture, or a Stripe payment method still clearing, such as a bank debit or a redirect method) and the status is Payment Pending. Keep polling the GET /user/invoices/{invoice_id} endpoint.
- declined — The gateway declined the payment method. Present another payment method.
- failed — The attempt did not complete. Try again.
Request
- Base URLhttps://developers.whmcs.com/api/v2
- Authnone declared
Path parameters
invoice_idinteger required
Example:456
Invoice ID
Request body
Example request
{
"provider_reference": "pi_3Ph2M2HeadlessIntent"
}Response
The gateway's outcome.
A 200 status indicates that the system attempted confirmation and received a response, not that payment succeeded.
Example response
{
"data": {
"payment": {
"status": "paid",
"message": "INSTRUMENT_DECLINED"
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.