S2S UPI Collect
Initiate a UPI Collect payment directly from your server and request approval on the customer’s UPI app.
Create the order on your server
Create a new FiatPe order for each payment attempt. Amounts use the smallest currency sub-unit: for INR, 5000 represents ₹50.00. Store the returned order ID against your internal order before using it in the S2S payment request.
Server request example
Use your FiatPe credentials only from a trusted backend environment.
REQUEST
curl --request POST \
--url https://api.fiatpe.com/v1/orders/ \
--header "Authorization: Basic YOUR_BASE64_CREDENTIALS" \
--header "Content-Type: application/json" \
--data '{
"amount": 5000,
"currency": "INR"
}'Response
Store the returned data.id and pass it as the order_id in Step 2.
{
"data": {
"id": "order_2f40f08f4baa4e5b",
"amount": 5000,
"entity": "order",
"status": "created",
"currency": "INR",
"metadata": {},
"created_at": 1788148983,
"return_url": null,
"amount_paid": 0,
"bank_details": null,
"return_method": "POST",
"amount_pending": 5000
},
"message": "order created successfully."
}Initiate a payment
Send this request from your backend. Generate the Basic authorization value by Base64 encoding api_key:secret_key. Never expose either credential in browser or mobile application code.
REQUEST
curl --location 'https://api.fiatpe.com/v1/payments/create/s2s/' \
--header 'Authorization: Basic <base64(api_key:secret_key)>' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 5000,
"currency": "INR",
"contact": "+919898989898",
"name": "Aftab Hussain",
"email": "customer@example.com",
"order_id": "order_75db8a5703ba4d3a",
"return_url": "https://example.com/payment/return",
"description": "Test payment",
"method": "upi",
"upi": {
"flow": "collect",
"vpa": "fiatpe@success"
},
"metadata": {
"note_key": "value1"
}
}'Request fields
Response
Store the returned payment_id. Use it to track the payment and reconcile the final status through your backend and webhooks.
{
"payment_id": "FIATPEST7LGJ0HOP9H1790703210"
}Handle the final result
- Do not mark the order as paid from the initiation response.
- Wait for the customer to approve the collect request in their UPI app.
- Confirm the final payment status from your server and process FiatPe webhooks idempotently.
- Match the payment ID, order ID, amount, and currency before fulfilment.