Confirm Payment
Confirm a payment intent to finalize the transaction.
POST
https://api.uprails.com/payments/:payment_id/confirmConfirms a payment intent that was previously created with confirm: false. This action attempts to authorize the payment with the payment processor.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
payment_id | string | Required. The ID of the payment to confirm. |
Body Parameters
payment_method_dataobjectThe payment method information provided for making a payment.
cardobjectCard details
card_numberstringrequiredCard number
card_exp_monthstringrequiredExpiry month
card_exp_yearstringrequiredExpiry year
card_cvcstringrequiredCVC code
card_holder_namestringCard holder name
payment_methodstringIndicates the type of payment method (e.g., 'card', 'wallet').
payment_method_typestringIndicates the sub type of payment method (e.g., 'credit', 'debit').
customer_acceptanceobjectDetails of customer acceptance for the payment.
Request Example
Confirm Payment
curl -X POST https://api.uprails.com/payments/pay_mbabizu24mvu3mela5njyhpit4/confirm \
-H "Content-Type: application/json" \
-H "api-key: snd_YOUR_API_KEY" \
-d '{
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "12",
"card_exp_year": "2025",
"card_cvc": "123"
}
}
}'Response
200OK
{
"payment_id": "pay_mbabizu24mvu3mela5njyhpit4",
"status": "succeeded",
"amount": 6540,
"currency": "USD",
"payment_method": "card",
"client_secret": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
"created": "2024-01-22T10:11:12Z",
"modified_at": "2024-01-22T10:20:00Z",
"customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44"
}