API Docs
Payments
API ReferencePaymentsConfirm Payment

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").
payment_method_dataobjectNoPayment instrument details. Use payment_method_data.crypto when confirming a crypto payment.
billingobjectYesCustomer billing details for the payment. Required when this request includes payment_method_data. See billing.
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.

billing

ParameterTypeRequiredDescription
address.line1stringYesAddress line 1.
address.line2stringNoAddress line 2.
address.citystringYesCity.
address.statestringYesState or province.
address.zipstringYesPostal or ZIP code.
address.countrystringYesTwo-letter ISO country code (e.g., "US").
address.first_namestringYesFirst name.
address.last_namestringYesLast name.
phone.numberstringYesPhone number.
phone.country_codestringYesCountry code (e.g., "+1").

payment_method_data.card

ParameterTypeRequiredDescription
card_numberstringYesCard number.
card_exp_monthstringYesExpiry month.
card_exp_yearstringYesExpiry year.
card_cvcstringYesCVC code.
card_holder_namestringNoCard holder name.

payment_method_data.crypto

ParameterTypeRequiredDescription
pay_currencystringYesCrypto asset the customer receives, such as BTC or ETH.
networkstringNoBlockchain network when required for the selected asset.
wallet_addressstringYesDestination wallet address.
wallet_address_tagstringNoDestination memo, tag, or extra address field when required by the network.
payment_method_idstringNoUpstream payment option identifier when a quote flow supplies one.
external_customer_idstringNoCustomer reference to send to the upstream crypto checkout.

Request Example

curl -X POST 'https://api.rpayz.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"    }  },  "billing": {    "address": {      "line1": "1600 Amphitheatre Parkway",      "city": "Mountain View",      "state": "CA",      "zip": "94043",      "country": "US",      "first_name": "Jane",      "last_name": "Customer"    },    "phone": {      "number": "6502530000",      "country_code": "+1"    }  }}'

Hosted crypto checkout example

curl -X POST 'https://api.rpayz.com/payments/pay_mbabizu24mvu3mela5njyhpit4/confirm' \  -H "Content-Type: application/json" \  -H "api-key: snd_YOUR_API_KEY" \  -d '{  "payment_method": "crypto",  "payment_method_type": "crypto_currency",  "return_url": "https://example.com/payment-return",  "payment_method_data": {    "crypto": {      "pay_currency": "BTC",      "wallet_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"    }  },  "billing": {    "address": {      "line1": "1600 Amphitheatre Parkway",      "city": "Mountain View",      "state": "CA",      "zip": "94043",      "country": "US",      "first_name": "Jane",      "last_name": "Customer"    },    "phone": {      "number": "6502530000",      "country_code": "+1"    }  }}'

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"
}