Fiat Checkout Quick Start
This document provides a quick overview of how to create a fiat checkout order and receive payments from users.
Fiat Checkout Order
This API creates a payin order and returns a website url. The website returned can be loaded in a browser. User can complete their payment in this webpage. Once the user has done the payment, the webpage shows success screen and redirects the user to the callbackUrl. Pay3 backend also sends events to your backend service updating realtime status update of the payment. Once you receive the event, you could call order details API to get the status, paid amount and payment details.
Steps
Step 1: Get Access Token
To generate the Access Token, you will call the API with the api-secret and client-id. Please refer to the Access Token.
Step 2: Create a Signature with Parameters
The request to create a crypto checkout order requires a header signature. This can be generated using the javascript code snippet here Signature Generation .
Step 3: Call Create Fiat Checkout Order API.
Sample Payload
const payloadFiatCheckout = {
"requestId": "......", // TODO: Application’s Order Id, send unique id for every order (preferably UUID)
"currencyId": "usd_usa", // Please reach out to Pay3 team for enabled currencies,countries in your clientId
"fiatAmount": "5.00", // Fiat Amout in specified currency (in this in USD)
"paymentMethodId" : "card", // Payment method enabled for your client ID for this currency,country.
"clientId":"....",// TODO: your clientId
"email": "[email protected]", //pass the email for the user (Will be considered uniqueId if userId is not passed).
"mode": "returnUrl", // Optional: This will return standalone web url to accpet crypto payment
"callbackUrl": "https://yoursite.com/successpage" // Optional: This will return the user
}
Sample response
{
"requestId": "9824649238",
"token": "a35dc551-9fb4-491c-9f9b-44d9c2ef4b32",
"status": "CREATED",
"offerInfoData": {
"userAddress": "[email protected]",
"clientId": "your-client-id",
"selectedPaymentMethod": "your-paymentMethodId",
"totalFiatAmount": "5.00",
"expiryTs": "2025-04-21T16:12:09.287975+00:00",
"currencyId": "your-currency-id",
"type": "BUY"
},
"url": "https://pprod-ui.pay3.app/..."
}Step 4: Redirect User to Checkout Page
Once the user clicks on Checkout, redirect the user to the "url" in the response above.
Step 5: User Makes the Payment
The user enters card details and complete the payment.
Step 6: Payment Verified by Pay3
The Pay3 backend detects and verifies the transaction. Once confirmed, the checkout page displays a success screen.
Step 7: Redirect to Merchant Callback URL
UI is redirected to callbackUrl provied in the Create Order payload here eg: "https://yoursite.com/successpage".
Step 8: Listen for Webhook Events
Pay3 backend sends webhook notifications with status updates. Upon receiving an event, you may call the Get Fiat Order Details to retrieve the latest order details.