Payments
API ReferencePaymentsConfirm
Confirm Payment
Confirm a payment intent to finalize the transaction.
POST /payments/:payment_id/confirm
Confirms 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
| Parameter | Type | Required | Description |
|---|---|---|---|
payment_method | string | No | Indicates the type of payment method (e.g., "card", "wallet"). |
payment_method_type | string | No | Indicates the sub type of payment method (e.g., "credit", "debit"). |
customer_acceptance | object | No | Details of customer acceptance for the payment. |
browser_info | object | No | Browser and device information for fraud detection and 3DS authentication. Recommended for all card payments. |
browser_info
| Parameter | Type | Required | Description |
|---|---|---|---|
ip_address | string | No | IP address of the client. |
user_agent | string | No | User-agent of the browser. |
accept_header | string | No | Specifies accepted content types from the browser. |
accept_language | string | No | Accept-language header from the browser. |
language | string | No | Language supported by the browser (e.g., "en-US"). |
color_depth | integer | No | Color depth supported by the browser (e.g., 24). |
screen_height | integer | No | The screen height in pixels. |
screen_width | integer | No | The screen width in pixels. |
time_zone | integer | No | Time zone of the client (UTC offset in minutes). |
java_enabled | boolean | No | Whether Java is enabled in the browser. |
java_script_enabled | boolean | No | Whether JavaScript is enabled in the browser. |
os_type | string | No | The OS type of the client device (e.g., "macOS", "Windows", "Android"). |
os_version | string | No | The OS version of the client device. |
device_model | string | No | The device model of the client. |
referer | string | No | Identifier of the source that initiated the request. |
Recommended for 3DS: Providing browser_info significantly improves 3D Secure authentication success rates. This is especially important on the confirm endpoint since it's typically called from the client side.
payment_method_data.card
| Parameter | Type | Required | Description |
|---|---|---|---|
card_number | string | Yes | Card number. |
card_exp_month | string | Yes | Expiry month. |
card_exp_year | string | Yes | Expiry year. |
card_cvc | string | Yes | CVC code. |
card_holder_name | string | No | Card holder name. |
Request Example
curl -X POST 'https://api.v2.paychtec.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": "2028", "card_cvc": "123" } }}'Response
{
"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"
}