Payments
API ReferencePayments
Payments
Accept and process payments from customers around the world with our global processing infrastructure.
Overview
The Payments API allows you to create, confirm, capture, and manage payments. Uprails supports multiple payment methods including cards, bank transfers, and digital wallets.
Quick Start
Create your first payment with just a few lines of code:
curl -X POST 'https://api.v2.paychtec.com/payments' \ -H "Content-Type: application/json" \ -H "api-key: snd_YOUR_API_KEY" \ -d '{ "amount": 1000, "currency": "USD", "profile_id": "YOUR_PROFILE_ID", "confirm": true, "payment_method": "card", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "12", "card_exp_year": "2028", "card_cvc": "123" } }}'Payment Object
{
"payment_id": "pay_1234567890abcdef",
"merchant_id": "mer_abcdef123456",
"status": "succeeded",
"amount": 1000,
"amount_received": 1000,
"amount_capturable": 0,
"currency": "USD",
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"brand": "visa",
"exp_month": "12",
"exp_year": "2028"
}
},
"customer_id": "cus_xyz789",
"email": "customer@example.com",
"description": "Order #12345",
"statement_descriptor": "UPRAILS",
"metadata": {
"order_id": "12345"
},
"created": "2024-01-15T10:30:00Z",
"modified_at": "2024-01-15T10:30:05Z"
}API Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /payments | Create Payment |
POST | /payments/:id | Update Payment |
POST | /payments/:id/confirm | Confirm Payment |
GET | /payments/:id | Retrieve Payment |
GET | /payments/list | List Payments |
Payment Status
A payment can be in one of the following statuses:
| Status | Description |
|---|---|
requires_payment_method | Payment needs a payment method to be attached |
requires_confirmation | Payment method attached, awaiting confirmation |
requires_action | Additional action required (e.g., 3DS authentication) |
processing | Payment is being processed by the payment processor |
requires_capture | Payment authorized, awaiting capture (manual capture only) |
succeeded | Payment completed successfully |
failed | Payment was unsuccessful |
cancelled | Payment was cancelled |
Capture Methods
| Method | Description |
|---|---|
automatic | Payment is captured immediately upon authorization (default) |
manual | Payment is authorized first, then captured separately. Use for two-step payment flows. |
Manual Capture: When using manual capture, authorized payments must be captured within 7 days or the authorization will expire.