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:
Create Payment
curl -X POST https://api.uprails.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": "2025",
"card_cvc": "123"
}
}
}'Payment Object
Payment Objectjson
{
"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": "2025"
}
},
"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
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 failed |
| cancelled | Payment was cancelled |
Capture Methods
When creating a payment, you can specify how funds should be captured:
| Method | Description |
|---|---|
automatic | Funds are captured automatically when the payment is confirmed (default) |
manual | Authorize now, capture later. Useful for orders that need fulfillment before charging |
scheduled | Capture at a specific time in the future |
Authorization Hold
With manual capture, authorized funds are held for up to 7 days. Make sure to capture before the authorization expires.