Payment Gateway
Creates a payment order and returns a hosted checkout link and a UPI intent link. You get the payment status by webhook once the customer pays.
- Source
- RBI-authorised payment aggregator partners
- Turnaround
- Payment status in real time; settlement as per the aggregator's cycle
- Endpoint
- POST /v1/payments/orders
- Who can use it
- Registered businesses approved by the aggregator partner, outside restricted categories.
Overview
If you're already verifying customers with us, you can collect from them here too. Create an order and send the customer to a hosted checkout, or use the UPI intent link for a UPI-first flow. You get a webhook when they pay. Payments are processed by RBI-authorised payment aggregator partners; we provide the integration and support.
Good to know
Approval and pricing are decided by the aggregator partner. Some business categories won't be accepted.
What you get
- UPI firstUPI intent and QR for mobile users, plus cards, net banking and wallets.
- Hosted checkoutSend customers to a hosted page so card data never touches your servers.
- Webhooks and status APIKnow as soon as an order is paid, and query any order's status later.
- One support teamThe same team helps with verification and payment questions.
Request
POST https://api.ampletrails.com/v1/payments/orders
| Field | Type | Status | Description |
|---|---|---|---|
amount | number | Required | Amount in ₹ |
currency | string | Optional | Currency code |
order_id | string | Required | Your unique order reference |
customer_name | string | Optional | Customer name |
customer_mobile | string | Optional | Customer mobile |
return_url | string | Required | Where to send the customer after payment |
Response
Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.
| Field | Meaning | Example |
|---|---|---|
payment_order_id | Gateway order identifier | pg_ord_4c11e2 |
checkout_url | Hosted checkout link | https://pay.example/… |
upi_intent | UPI deep link / QR payload for UPI-first flows | upi://pay?… |
status | created, paid, failed or expired | created |
payment_method | Method used once paid | null |
Example
curl -X POST https://api.ampletrails.com/v1/payments/orders \
-H "Authorization: Bearer $AMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 1499, "currency": "INR", "order_id": "ORD-2026-55120", "customer_name": "Ravi Kumar", "customer_mobile": "9876543210", "return_url": "https://example.com/payment/return"}'import os, requests
resp = requests.post(
"https://api.ampletrails.com/v1/payments/orders",
headers={"Authorization": f"Bearer {os.environ['AMPLE_API_KEY']}"},
json={
"amount": 1499,
"currency": "INR",
"order_id": "ORD-2026-55120",
"customer_name": "Ravi Kumar",
"customer_mobile": "9876543210",
"return_url": "https://example.com/payment/return"
},
timeout=30,
)
resp.raise_for_status()
print(resp.json()["data"])const resp = await fetch("https://api.ampletrails.com/v1/payments/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMPLE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"amount": 1499,
"currency": "INR",
"order_id": "ORD-2026-55120",
"customer_name": "Ravi Kumar",
"customer_mobile": "9876543210",
"return_url": "https://example.com/payment/return"
}),
});
const { data } = await resp.json();$ch = curl_init("https://api.ampletrails.com/v1/payments/orders");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AMPLE_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["amount" => 1499, "currency" => "INR", "order_id" => "ORD-2026-55120", "customer_name" => "Ravi Kumar", "customer_mobile" => "9876543210", "return_url" => "https://example.com/payment/return"]),
]);
$data = json_decode(curl_exec($ch), true)["data"];{
"status": "success",
"request_id": "req_7f3a9c21e4",
"data": {
"payment_order_id": "pg_ord_4c11e2",
"checkout_url": "https://pay.example/…",
"upi_intent": "upi://pay?…",
"status": "created",
"payment_method": null
}
}Example data. The exact field list for your account comes with your sandbox documentation.
Use cases
Processing and onboarding fees
Collect a processing fee or security deposit at the end of onboarding.
Subscription start
Take the first payment for a plan before setting up a mandate.
Rental deposits
Collect deposits from verified tenants.
Questions about this API
Is AmpleTrails a payment aggregator?
No. Payments are processed by RBI-authorised payment aggregator partners, who hold the merchant relationship and settle funds to you.
What do we need to sign up?
Business KYC documents, a current account and a website or app that meets the aggregator's requirements, such as visible terms, refund policy and contact details.
How quickly are funds settled?
Settlement timelines are set by the aggregator, usually a day or two after payment. Your agreement will state them.
Are some businesses not allowed?
Yes. Aggregators restrict certain categories, such as gambling and some financial products. Check with us before you apply.
Try the Payment Gateway API
Sandbox keys, the full field reference and a Postman collection, usually within a working day.