API Docs
Payments
API ReferencePaymentsCreate

Create Payment

Create a payment resource to start a checkout process.

POST /payments

Creates a payment resource, which represents a customer's intent to pay. This endpoint is the starting point for various payment flows.

Body Parameters

ParameterTypeRequiredDescription
amountintegerYesThe primary amount for the payment, provided in the lowest denomination of the specified currency (e.g., 6540 for $65.40 USD).
currencystringYesThe three-letter ISO 4217 currency code (e.g., "USD", "EUR") for the payment amount.
profile_idstringYesThe identifier for the business profile associated with this payment.
payment_idstringNoA unique identifier for the payment. If not provided, Uprails will generate one.
confirmbooleanNoIf set to true, Uprails attempts to confirm and authorize the payment immediately after creation.
customer_idstringNoThe identifier for the customer.
descriptionstringNoAn arbitrary string attached to the payment.
return_urlstringNoThe URL to redirect the customer to after they complete the payment process.
capture_methodstringNoThe capture method for the payment. Use "automatic" to capture immediately, or "manual" to authorize now and capture later. Defaults to "automatic".
authentication_typestringNoThe authentication type for the payment. Use "three_ds" to enforce 3D Secure, or "no_three_ds" to skip it (when supported by the connector).
emailstringNoThe customer's email address.
payment_methodstringNoThe top-level payment method category (card, bank_transfer, wallet, pay_later, bank_redirect). Required when confirm is true.
payment_method_typestringNoThe specific payment method (credit, debit, apple_pay, google_pay, klarna, pix, boleto, etc.). Pair with payment_method. See Payment method types.
payment_method_dataobjectNoPayment instrument details (card data, wallet token, bank account). See payment_method_data.
setup_future_usagestringNoStores the payment method for future use. Use on_session if the customer is present at the next charge or off_session for merchant-initiated charges (subscriptions, top-ups).
merchant_order_reference_idstringNoYour own unique reference for this order (max 255 chars). Forwarded to the connector when supported and useful for reconciliation against your own systems.
shippingobjectNoShipping address. Same shape as billing.
statement_descriptor_namestringNoText shown on the customer's card statement (max 22 chars, must contain at least one letter).
statement_descriptor_suffixstringNoSuffix appended to the merchant's default statement descriptor. Useful when several products share one merchant account.
metadataobjectNoUp to 50 key-value pairs (key max 40 chars, value max 500 chars) for your own bookkeeping. Echoed back on retrieval.
browser_infoobjectNoBrowser and device information for fraud detection and 3DS authentication. Recommended for all card payments. See browser_info.

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. Include at least ip_address and user_agent for all card payments.

Payment method types

The most common combinations of payment_method and payment_method_type merchants integrate with:

payment_methodpayment_method_typeNotes
cardcredit, debitPair with payment_method_data.card.
walletapple_payPair with payment_method_data.wallet.apple_pay. Requires Apple Pay merchant identity configured at the profile level.
walletgoogle_payPair with payment_method_data.wallet.google_pay. Requires Google Pay merchant identity configured at the profile level.
walletpaypal, samsung_pay, ali_pay, we_chat_payEach wallet has its own data shape under payment_method_data.wallet.<name>.
pay_laterklarna, affirm, afterpay_clearpayBuy-now-pay-later providers. Pass customer email and billing address.
bank_redirectideal, sofort, bancontact, eps, giropayEuropean bank redirects. Pair with payment_method_data.bank_redirect.<name> and return_url.
bank_transferpix, ach, sepa, bacs, multibanco, boletoPair with payment_method_data.bank_transfer.<name>. Pix and Boleto serve the Brazilian market.
upiupi_collect, upi_intentIndian UPI flows.

payment_method_data

ParameterTypeRequiredDescription
cardobjectNoCard details. Required when payment_method is "card".
card.card_numberstringYesThe card number (e.g., "4242424242424242").
card.card_exp_monthstringYesThe two-digit expiry month (e.g., "12").
card.card_exp_yearstringYesThe four-digit expiry year (e.g., "2028"). Must be a future date.
card.card_cvcstringYesThe card verification code (3 or 4 digits).
card.card_holder_namestringNoThe name on the card.
walletobjectNoWallet payload. Use one of wallet.apple_pay, wallet.google_pay, wallet.paypal, etc. The shape comes from the wallet SDK on the client.

billing

ParameterTypeRequiredDescription
address.line1stringNoAddress line 1.
address.line2stringNoAddress line 2.
address.citystringNoCity.
address.statestringNoState or province.
address.zipstringNoPostal or ZIP code.
address.countrystringNoTwo-letter ISO country code (e.g., "US").
address.first_namestringNoFirst name.
address.last_namestringNoLast name.
phone.numberstringNoPhone number.
phone.country_codestringNoCountry code (e.g., "+1").

Request Example

curl -X POST 'https://api.v2.paychtec.com/payments' \  -H "Content-Type: application/json" \  -H "api-key: snd_YOUR_API_KEY" \  -d '{"amount": 6540,"currency": "USD","profile_id": "YOUR_PROFILE_ID","customer_id": "YOUR_CUSTOMER_ID","description": "Premium subscription","capture_method": "automatic","email": "guest@example.com","authentication_type": "three_ds","billing": {  "address": {    "line1": "1600",    "line2": "Amphitheatre Parkway",    "city": "Mountain View",    "state": "California",    "zip": "94043",    "country": "US",    "first_name": "John",    "last_name": "Doe"  },  "phone": {    "number": "6502530000",    "country_code": "+1"  }},"browser_info": {  "ip_address": "203.0.113.42",  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",  "accept_header": "text/html",  "language": "en-US",  "color_depth": 24,  "screen_height": 1080,  "screen_width": 1920,  "time_zone": -300,  "java_enabled": false,  "java_script_enabled": true}}'

Response

{
  "payment_id": "pay_mbabizu24mvu3mela5njyhpit4",
  "status": "requires_payment_method",
  "amount": 6540,
  "currency": "USD",
  "client_secret": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
  "created": "2024-01-22T10:11:12Z",
  "customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
  "profile_id": "pro_xxxxx",
  "description": "It's my first payment request",
  "metadata": {}
}

Next steps

  • Confirm — attach payment_method_data and authorize.
  • Capture — settle a manual-capture payment.
  • Cancel — release the authorization.
  • Approve / Reject — resolve a manual-review hold.
  • Business profiles — learn how return_url and webhook_details are configured at the profile level.