API Docs
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

ParameterTypeDescription
payment_idstringRequired. The ID of the payment to confirm.

Body Parameters

ParameterTypeRequiredDescription
payment_methodstringNoIndicates the type of payment method (e.g., "card", "wallet").
payment_method_typestringNoIndicates the sub type of payment method (e.g., "credit", "debit").
customer_acceptanceobjectNoDetails of customer acceptance for the payment.
browser_infoobjectNoBrowser and device information for fraud detection and 3DS authentication. Recommended for all card payments.

browser_info

ParameterTypeRequiredDescription
ip_addressstringNoIP address of the client.
user_agentstringNoUser-agent of the browser.
accept_headerstringNoSpecifies accepted content types from the browser.
accept_languagestringNoAccept-language header from the browser.
languagestringNoLanguage supported by the browser (e.g., "en-US").
color_depthintegerNoColor depth supported by the browser (e.g., 24).
screen_heightintegerNoThe screen height in pixels.
screen_widthintegerNoThe screen width in pixels.
time_zoneintegerNoTime zone of the client (UTC offset in minutes).
java_enabledbooleanNoWhether Java is enabled in the browser.
java_script_enabledbooleanNoWhether JavaScript is enabled in the browser.
os_typestringNoThe OS type of the client device (e.g., "macOS", "Windows", "Android").
os_versionstringNoThe OS version of the client device.
device_modelstringNoThe device model of the client.
refererstringNoIdentifier 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

ParameterTypeRequiredDescription
card_numberstringYesCard number.
card_exp_monthstringYesExpiry month.
card_exp_yearstringYesExpiry year.
card_cvcstringYesCVC code.
card_holder_namestringNoCard 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"
}