API v1FiatPe Home
THIRD-PARTY VALIDATION

TPV Standard Integration

Create a FiatPe order with the customer’s registered bank account, open Checkout with the returned order_id, and verify the completed payment on your server.

Prerequisites

  • TPV is activated for your FiatPe account.
  • Your server securely stores the customer’s verified bank details.
  • You have FiatPe Test API credentials and have selected Hosted or Embedded Checkout for your customer journey.
  • Your backend verifies signatures and the final payment status.

Choose a checkout experience

TPV supports both checkout options. Account ownership is validated using the registered bank_details; the checkout option determines where the customer completes payment.

1. Build the integration

  1. 1

    Collect registered bank details

    Collect and verify the customer’s account number, account-holder name, and IFSC during onboarding.

  2. 2

    Create the TPV payment context

    Send the customer’s registered bank account when creating a Checkout Session or order.

  3. 3

    Open FiatPe Checkout

    Redirect to Hosted Checkout or pass the returned order ID to Checkout.js for Embedded Checkout.

  4. 4

    Handle the result

    Handle success and failure callbacks without treating the browser response as authoritative.

  5. 5

    Store identifiers

    Persist the FiatPe order ID and payment ID against your internal customer and transaction records.

  6. 6

    Verify the payment

    Verify the SHA-512 signature and fetch the final payment status before fulfilment.

2. Create the TPV payment context

Always create the Checkout Session or order on your server. Include the customer's verified bank_details so FiatPe can perform TPV matching. Never accept these values from untrusted browser input.

POSThttps://api.fiatpe.com/v1/orders/session/

Hosted Checkout: create a session

Use this flow when the customer completes payment on the FiatPe-hosted page. The session request must include the bank account registered and verified for that customer.

Hosted TPV Session cURL
Copy
curl -X POST https://api.fiatpe.com/v1/orders/session/ \
  -H "Authorization: Basic YOUR_BASE64_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50000,
    "currency": "INR",
    "method": "UPI",
    "reference_id": "INVESTMENT_13375649",
    "return_url": "https://example.com/",
    "return_method": "POST",
    "bank_details": {
      "account_number": "765432123456789",
      "name": "Customer Name",
      "ifsc": "HDFC0000053"
    },
    "metadata": {
      "customer_id": "customer_12345"
    },
    "expires_at": 1792998833
  }'

Hosted Checkout Session response

Store the returned order and session identifiers, then redirect the customer to data.checkout_url to continue payment on FiatPe Hosted Checkout.

JSON Response
Copy
{
  "data": {
    "id": "order_ecc8937cde1b4980",
    "session_id": "74ea117bd1710e0a1e97e9f3ff6c1442ba6063a3c541580d6dc3d8cf1702ab00",
    "entity": "order",
    "currency": "INR",
    "amount": 1000,
    "amount_pending": 1000,
    "amount_paid": 0,
    "method": null,
    "status": "created",
    "metadata": {},
    "checkout_url": "https://api.fiatpe.com/hosted/74ea117bd1710e0a1e97e9f3ff6c1442ba6063a3c541580d6dc3d8cf1702ab00/",
    "return_url": null,
    "return_method": "POST",
    "expires_at": 1792998624,
    "created_at": 1792822494,
    "bank_details": null
  },
  "message": "order created successfully."
}

How to collect the payment

The /v1/orders/session/ API does not collect payment by itself. It creates a secure checkout session and returns a checkout_url. Redirect the customer to that URL so they can choose a payment method and complete the payment.

  1. 1

    Create the session on your backend

    Call POST /v1/orders/session/ with the amount, return configuration, and verified TPV bank details. Never expose your API credentials in frontend code.

  2. 2

    Store the returned identifiers

    Save data.id and data.session_id against your internal transaction before redirecting the customer.

  3. 3

    Redirect to Hosted Checkout

    Send data.checkout_url to your frontend and redirect the customer to that exact URL. Do not construct the hosted URL manually.

  4. 4

    Handle the customer return

    After checkout, FiatPe returns the customer to the configured return_url using the selected return_method.

  5. 5

    Verify before fulfilment

    Confirm the authoritative payment status on your backend or through a verified webhook. Never treat the browser redirect alone as proof of payment.

Browser redirect example
Copy
// Response returned by your backend after it creates the Checkout Session
const session = await response.json();

// Redirect the customer to the exact checkout_url returned by FiatPe
window.location.assign(session.data.checkout_url);
Use the returned checkout URL as-is.

The session URL identifies the payment context. Do not edit it, generate it from the session ID, or expose server credentials while redirecting the customer.

Handle the Hosted Checkout return

After the payment attempt, FiatPe sends the result to the configured return_url. When return_method is POST, your return endpoint should accept the submitted form fields and render an appropriate success or failure experience.

Successful payment return

A successful return contains the payment ID, order ID, and signature. Verify the signature and confirm the final payment status on your backend before marking the transaction as paid.

Success return payload
Copy
{
  "payment_id": "FIATPESTYQHKCXNANT1792823689",
  "order_id": "order_604cb9510bdd4e52",
  "signature": "e58e45536ff8aebe36ea0685c95aa738ba4c4864b350a70286c2bd0b92bd1370cbfa3b92f7f7b62079c5448a010450eec895c429339636348bd826f4a9c43774"
}

Failed payment return

A failed return contains bracket-notation error fields. Parse these fields as submitted, retain the payment ID for support and reconciliation, and show the customer a safe retry option when appropriate.

Failure return payload
Copy
{
  "error[code]": "PAYMENT_FAILED",
  "error[description]": "Insufficient balance in your bank account. Please add funds and try again.",
  "error[source]": "business",
  "error[step]": "payment_processing",
  "error[reason]": "payment_failed",
  "error[metadata][payment_id]": "FIATPEST8RRKLHIZO31792822902"
}
A return payload is not the final source of truth.

Use the success payload for the customer journey, but verify its signature and authoritative server-side payment status before fulfilment. Never mark an order paid from the browser redirect alone.

POSThttps://api.fiatpe.com/v1/orders/
Open Create Order API →

Embedded Checkout: create an order

Send the bank account that was registered and verified for the customer.

cURL
Copy
curl -X POST https://api.fiatpe.com/v1/orders/ \
  -H "Authorization: Basic YOUR_BASE64_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50000,
    "currency": "INR",
    "method": "UPI",
    "reference_id": "INVESTMENT_13375649",
    "bank_details": {
      "account_number": "765432123456789",
      "name": "Customer Name",
      "ifsc": "HDFC0000053"
    },
    "metadata": {
      "customer_id": "customer_12345"
    }
  }'

Example response

JSON Response
Copy
{
  "data": {
    "id": "order_2f40f08f4baa4e5b",
    "amount": 100,
    "entity": "order",
    "status": "created",
    "currency": "INR",
    "method": "UPI",
    "metadata": {},
    "created_at": 1788148983,
    "return_url": null,
    "amount_paid": 0,
    "bank_details": {
      "account_number": "765432123456789",
      "name": "Customer Name",
      "ifsc": "HDFC0000053"
    },
    "reference_id": null,
    "return_method": "POST",
    "amount_pending": 100
  },
  "message": "order created successfully."
}

Request parameters

ParameterRequiredDescription
amountYesPayment amount in the currency’s smallest sub-unit.
currencyYesThree-letter currency code. Use INR for this flow.
methodNoCan use UPI to restrict the payment method to UPI. Otherwise, can choose any of the payment methods enabled for you.
reference_idRecommendedYour unique internal order or investment reference.
return_urlRequired for Hosted CheckoutThe HTTPS page where FiatPe returns the customer after checkout.
return_methodNoHTTP method used for the return flow. This example uses POST.
bank_detailsYes for TPVThe bank account registered and verified for the customer.
bank_details.account_numberYesRegistered bank account number.
bank_details.nameYesName associated with the registered account.
bank_details.ifscYesIFSC of the registered bank branch.
metadataNoInternal key-value data used for reconciliation.

3. Test the integration

Use only FiatPe Test credentials and test payment details. Test successful matching, account mismatch, failure, cancellation, duplicate callback, and retry flows before going live.

4. Go live

Enable Live credentials only after FiatPe has activated TPV and your compliance team has approved the flow. Continue to verify the signature and authoritative payment status before fulfilling every transaction.

Bank details are sensitive.

Never place the Salt Key or full registered bank details in browser code, URLs, analytics, or application logs.