API v1FiatPe Home
FiatPeDocs
SERVER 2 SERVER

S2S UPI Collect

Initiate a UPI Collect payment directly from your server and request approval on the customer’s UPI app.

STEP 1

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.

Open the Create Order API reference

Server request example

Use your FiatPe credentials only from a trusted backend environment.

REQUEST

Curl
Copy
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.

200 OK
Copy
{
  "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."
}
STEP 2

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
Copy
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

FieldRequiredDescription
amountYesPayment amount in the currency’s smallest sub-unit. For INR, 5000 represents ₹50.00.
currencyYesThree-letter currency code. Use INR for Indian Rupees.
contactYesCustomer phone number including the country code.
nameYesCustomer’s full name.
emailYesCustomer email address.
order_idYesOrder ID returned by the Create Order API.
return_urlYesHTTPS URL used after the payment flow completes.
descriptionNoDescription associated with the payment.
methodYesSet to upi.
upi.flowYesSet to collect.
upi.vpaYesCustomer’s valid Virtual Payment Address.
metadataNoMerchant-defined key-value data associated with the payment.

Response

Store the returned payment_id. Use it to track the payment and reconcile the final status through your backend and webhooks.

200 OK
Copy
{
  "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.