
[title] Initialize
[path] Untitled/

The Unity SDK needs to be initialised with configuration information associated with the mobile application,  firebase realtime database and Pay3 environment settings.

&#x20;**Initialization Parameters**

1. **pay3HostName**: Pay3 will be opened in a new window using this hostname prefix. The host name is environment dependent.&#x20;
2. **pay3ClientId**: A unique client id is created for each client application. The client id is environment dependent.
3. **appNotify\* Configs**: These are config parameters for firebase realtime database. This is used to publish realtime events to the app.
4. **appDeepLink**:  This string in the form of `scheme://resource` can be passed during initalization. This will be used by Pay3 as referrer / redirect intent. The string needs to be whitelisted in Pay3 backend for proper working of the Pay3 services.&#x20;

Following are the **sample code** **snippets** for your reference. The entire package with complete example will be provided during onboarding.

Game can use **Pay3SDKConfig.cs** which extends *ScriptableObject.*  This accepts all settings required for Pay3 SDK. Game can create an asset using this. The asset needs to be passed to *Pay3Helper.cs* instance.

:::CodeblockTabs
Pay3SDKConfig.cs

```cpp
using UnityEngine;

[CreateAssetMenu(fileName = "Pay3SDKConfig", menuName = "ScriptableObjects/Pay3SDKConfig", order = 1)]
public class Pay3SDKConfig : ScriptableObject
{
    public string androidPackageId;
    public string appNotifyApiKey;
    public string appNotifyAppId;
    public string appNotifyProjectId;
    public string appNotifyDatabaseUrl;
    public string appNotifyStorageBucket;
    public string appDeepLink;
    public string pay3ClientId;
    public string pay3HostName;
}

```
:::

Game can instantiate **Pay3Helper.cs** that extends *MonoBehaviour*.  This loads configuration from Pay3SDKConfig during the Start.&#x20;

:::CodeblockTabs
Pay3Helper.cs

```cpp
namespace Pay3.SDK.Helper {
  
  // Import essential packages
  using Firebase.Auth; 
  using Firebase.Database;
  using Firebase;
  using UnityEngine;
  

  public class Pay3Helper : MonoBehaviour {

    // Attach the Pay3SDKConfig to this Behaviour
    public Pay3SDKConfig sdkConfig; 
    
    
    // When the app starts, check to make sure that we have
    // the required dependencies to use Firebase, and if not,
    // add them if possible.
    public virtual void Start() { 
      InitializeFirebaseAuth();
    }

    // Handle initialization of the necessary firebase modules:
    private void InitializeFirebaseAuth() {
        authOptions = new Firebase.AppOptions {
            // Use Configuration from Pay3SDK Config
        };
        fbApp = Firebase.FirebaseApp.Create(authOptions, "Pay3");      
        auth = Firebase.Auth.FirebaseAuth.GetAuth(fbApp);
        SignInAnonymously();
    }

    // Request anonymous sign-in and wait until asynchronous call completes.
    private void SignInAnonymously() {  
      auth.SignInAnonymouslyAsync().ContinueWith((authTask) => {
        if (authTask.IsCompleted) {
            Firebase.Auth.FirebaseUser user = authTask.Result.User;
            StartTransactionListener(user.UserId);
            }
        });
    }
  }
}
```
:::

***


[title] Pay3 Javascript SDK
[path] /

Pay3 Javascript SDK provides a two-way communication with Pay3 webapp:

This can be integrated to the application using one of the following methods:&#x20;

1. NPM module [@pay3/sdk ](https://www.npmjs.com/package/@pay3/sdk)&#x20;
2. OR Script tag of the application's html file `https://pay3.money/pay3-sdk-pay/index.global.X.Y.Z.js`&#x20;

Pay3 webapp is a highly customisable. Following picture show high-level communication between the integrating App and Pay3.&#x20;

## Checkout Integration

Checkout flow can be utilised by the applications to get users buy and pay using their preferred local currencies.

### Integration Design

![](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/K2UKgFwHExp_rm9hHwWTW_pay3-sdk-checkout-integration.png)

## Payout Integration

Payout flow can be utilised by the application to allow users to withdraw funds from the application into their preferred payment instrument.   &#x20;

### Integration Design

![](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/FeH9VAxNNzQLR7fKH65VD_pay3-sdk-payout-integration.png)

## Crypto Payin Integration

Users can pay via Crypto for the product and services provided by the application.&#x20;

![Crypto Payin Integration Overview](https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-gu7bbgpgWdSpilAsugHS5-20240828-072348.png "Crypto Payin Integration Overview")

Above diagram shows the integration overview for Crypto payin.

***


[title] Get Fiat Order Details
[path] Pay3 API Documentation/

API that returns clients orders matching the *requestId*. This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

The response is a list of Orders which matches the given criteria.

1. `orderStatus` : For list of possible status please refer : [Fiat Order Status](docId:-_ZgIyFgAsxS2Uqr272QA)
2. `userAddress` : User's email address
3. `updatedTs` : Last Order updated timestamp in epoch milliseconds
4. `partner` : Downstream partner ID
5. `orderType` : Type of Order. Can be CHECKOUT/PAYOUT
6. `requestId` : Unique ID passed during Order creation
7. `clientId` : Client ID
8. `exchangeCurId` : Name of the currency supported
9. `exchangeAmount` : Currency Amount
10. `paymentMethod` : Payment Method specified for Order
11. `errorReason` : Contains `errorCode` and `errorDesc`. Will be received only in case if status is FAILED. List of possible [Error Codes](docId\:upvtC67WkwGNCSCjVAQ0v)

:::ApiMethodV2
```json
{
  "name": "Get Order Details",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v1/client/orders?requestId=your-request-id&clientId=your-client-id",
  "description": "Get order details by client's request-id",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "3LjxGJCqZzKeICMDOi23s",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/orders?requestId=your-request-id&clientId=your-client-id' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'access-token: ACCESS-TOKEN-IN-JWT'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "3LjxGJCqZzKeICMDOi23s"
  },
  "results": {
    "languages": [
      {
        "id": "GC_lbEEV7Jo_hgFNI1cHK",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"data\": [\n        {\n            \"orderId\": \"4073be54-5903-47c8-820f-17aa12964ba8\",\n            \"orderStatus\": \"FAILED\",\n            \"userAddress\": \"user@email.com\",\n            \"updatedTs\": 1706610264546,\n            \"partner\": \"xyz\",\n            \"orderType\": \"CHECKOUT\",\n            \"requestId\": \"900531\",\n            \"clientId\": \"YOUR-CLIENT-ID\",\n            \"exchangeCurId\": \"brl_bz\",\n            \"exchangeAmount\": \"2.00\",\n            \"paymentMethod\": \"pix\",\n            \"errorReason\": {\n                \"errorCode\": \"9004\",\n                \"errorDesc\": \"Error occurred while the payment was processed by the payment partner\"\n            }\n        }\n    ]\n}"
      },
      {
        "id": "Ybev9LI4TwGz-n2zW-919",
        "language": "401",
        "customLabel": "",
        "code": "{\"error\":\"Client verification failed\"}"
      }
    ],
    "selectedLanguageId": "GC_lbEEV7Jo_hgFNI1cHK"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Request Id is the unique id that was passed by your application while creating the order.",
        "children": []
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client Id",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-order-details",
  "legacyHash": "-iBJgsqJ9XnskOxFc1df4"
}
```
:::

***


[title] Agentic AI Payments
[path] /


[title] Invoicing and Billing Agent
[path] /


[title] Onboarding
[path] Overview/

Our onboarding process is designed to ensure a smooth and productive integration of our services into your operations. It involves understanding your business, establishing pricing agreements, and facilitating technical integration. This process is tailored to ensure both regulatory compliance and seamless technical integration, setting the stage for a successful partnership.&#x20;

## Phase 1: Know Your Business (KYB) Onboarding

### Step 1: Business Screening

In the initial step, we will collect and verify essential business information to ensure regulatory compliance and better understand your organisation. This process involves gathering and validating key details about your business.

### Step 2: Pricing Agreements

Following the KYB screening, we will proceed to discuss and confirm the pricing agreements. We will also engage in a dialogue to agree on any other relevant fees related to the integration process. This step ensures that we establish a transparent pricing structure tailored to your specific requirements.

## Phase 2: Technical Onboarding:

### Step 1: Domain Whitelisting

After the KYB onboarding, the technical phase begins with domain whitelisting. You will provide domain information for system access, and we will proceed to whitelist the specified domains, granting authorised access to our platform. This step is essential for secure and authorized interaction with our services.&#x20;

### Step 2: Enabling country currency for the application.&#x20;

This step involves integrating the appropriate country currency and mapping to best payment partner services for the client. into the system for in-game purchasing or other purposes. Pay3 routing engine requires onboarding of client to list of supported country currency. These registered currency names are used during transaction. For example `usd_us`, `gbp_gb`, `brl_bz`

### Step 3: API and SDK Key Sharing

In this step, we will share API hostnames, client IDs and SDK keys. These keys are required for accessing and utilizing our system's capabilities. We will also provide comprehensive instructions on how to effectively use these keys for system integration, ensuring a seamless technical onboarding process. This step is fundamental for the successful integration of our services into your operations. The rest of the document describes the functionality of our system in detail.

[title] Overview
[path] /

Pay3 provides the transactional infrastructure that powers a wide range of businesses e-commerce, travel, gaming, and digital services, helping them seamlessly onboard users and accept payments globally. We enable enterprises to accept **fiat payments, digital currencies, cryptocurrencies, and stablecoins** across mobile, web, and POS, ensuring smooth operations across all channels.

Our platform supports a variety of use cases, including **card and bank-based fiat payments, online checkout solutions, digital goods, remittances, on/off-ramps, and in-game purchases**.

Pay3’s solutions enable companies to launch and scale rapidly, offering a secure, cost-efficient, and reliable alternative to building and maintaining in-house payment infrastructure across both **fiat and digital asset rails**.

[title] Getting Started
[path] /

Pay3-Checkout allows you to set up widely used popular payment methods with just one integration, providing a smooth checkout process for your in-game purchases. Few lines of code is all needed to complete the integration, giving your users an excellent experience.

Following documentation will help you get up to speed with Pay3 SDK integration.

[title] Initialize using script tag
[path] Pay3 Javascript SDK/

## Include script dependency&#x20;

When using script dependency you can include the javascript's url with in the head section of the application.  X.Y.Z is the version of the javascript file, for instance: `https://pay3.money/pay3-sdk-pay/index.global.1.2.3.js`

:::CodeblockTabs
index.js

```html
<head>
  <script src="https://pay3.money/pay3-sdk-pay/index.global.X.Y.Z.js"></script>
</head>
```
:::

&#x20; This script creates a singleton instance of the Pay3 class and exports an object `window.pay3Pay`

## init()

Init saves the parameters which will be used during future function calls. It also registers a listener to listen for messages from Pay3. Pay3 team shares `hostname` and `clientId` during onboarding. &#x20;

**Parameters**

1. **hostname**: Pay3 will be opened in a new window using this hostname prefix. The host name is environment dependent.&#x20;
2. **clientId**: A unique client ID is created by the Pay3 team to identify the client application. The client ID is environment dependent.
3. **lang&#x20;**(optional, default value 'en'):  This parameter specifies the language preference for the Pay3 SDK. The strings used follow two letter language code as in ISO 639-1. Example **pt** for Portuguese, **en** for English.

:::CodeblockTabs
index.js

```javascript
window.pay3Pay.init(hostname, clientId);
```
:::

***


[title] Transactions
[path] Untitled/

### TriggerOpenCheckout

The application can use `TriggerOpenCheckout` to receive payments from the users. Here the Pay3 modal will guide user through fiat payment services and deposit the payment to the app's Fiat account. &#x20;

**checkoutPayload : JSON string with following parameters**

1. **requestId&#x20;**(Type string): App needs to generate a unique identifier for every checkout call. This ID will be provided in the events and Webhooks callbacks. This ID can be used by the App to identify and update state in App's backend. &#x20;
2. **user&#x20;**(Type Object): User details can be passed to Pay3 in this object.&#x20;
   1. **email** (Type string): Provide valid email address of user. This data will be passed to paymen partner during the Fiat checkout flow. Payment Partner might send mails to user updating them status of their transaction.
3. **payment** (Type Object): This section provides is the amount payable by the user of your platform. It could be cost price of your digital asset user wishes to checkout.&#x20;
   1. **amount** (Type string): String representing currency amount in two decimal precision. The amount is provided separately for each supported currency.
   2. **name** (Type string): Name of the currency supported in the purchase flow. The name will be provided by Pay3 during Onboarding.  &#x20;
4. **userMessage** (Type string): Short meaningful name of the asset user is about to purchase &#x20;

:::CodeblockTabs
Pay3Helper.cs&#x20;

```cpp
public class Pay3Helper : MonoBehaviour {
    // Pseudocode to trigger checkout using Fiat
    public void TriggerOpenCheckout()
    {
        string checkoutPayload = "{}"; // Create a checkout payload 
        byte[] plainTextBytes = Encoding.UTF8.GetBytes(checkoutPayload);
        string requestParam = Convert.ToBase64String(plainTextBytes);
        string reqUrl = "https://"+hostName+"/web-sdk/"+ clientId +"?referrer="+deepLink+"&action=checkout&data=" + requestParam;
        Application.OpenURL(reqUrl);   
    }
  }  
```
:::

***


[title] Pay3 Unity Integration
[path] /

Pay3 provides support for application developed using Unity. The SDK provides two-way communication with Pay3 webapp.&#x20;

Pay3 webapp is a versatile application that can handle various payment methods for your users. Pay3 publishes realtime events to native applications like Unity games using Firebase Realtime database.&#x20;

## Frontend Integration

![Pay3 SDK integration](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/G0ZydWW8QkCnTjR0T7VSq_nn-4.png "Native SDK Integration")

## Backend Integration

![Backend Integration](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/H3nD_gi9YI5CIbwWJK_yF_screenshot-2024-02-08-at-42354-pm.png "Backend Integration")

***


[title] Event Listeners
[path] Pay3 React Native SDK/

### &#x20;Introduction

After completing transactions in Pay3 SDK UI, the Pay3 SDK publishes events to App.&#x20;

### pay3-sdk-transaction-status

This event is fired by Pay3 SDK on completion of checkout transaction triggered by checkout webview `pay3.geCheckoutWebView()`

**Payload**

1. `data` (Type Object): Following keys are present in this object&#x20;
   1. `status` (Type string): The status can have values `SUCCESS` or `ERROR`.
   2. `message` (Type string): User-friendly message returned after completion of the transaction.
   3. `orderId` (Type string): Pay3 Order ID. &#x20;
   4. `requestId` (Type string): Unique id passed by App.
2. `error` (Type Object, Optional): Following keys will be present if there is an error. Please refer to [SDK Errors](docId\:upvtC67WkwGNCSCjVAQ0v) for reference.
   1. &#x20;`code` (Type number): Error code.
   2. `message` (Type string):  Error message.

:::CodeblockTabs
index.js

```javascript
pay3.on('pay3-sdk-transaction-status', (payload: any) => {
    // Add your custom logic to handle the transaction status 
    setPay3CheckoutVisibleState(false); // Can be used to hide the Checkout WebView
  },
);
```
:::

### Sample Event

```javascript
{
    "data": {
        "message": "Transaction completed successfully",
        "orderId": "7a38ee7f-d5a9-45c8-af6b-e75d4190722a",
        "receipt": "txnReceipt",
        "requestId": "252425",
        "status": "SUCCESS"
    },
    "ts": 1706087047736
}
```

***


[title] Transactions
[path] Pay3 React Native SDK/

### pay3.getCheckoutWebView(checkoutObj)

The application can use `getCheckoutWebView`, which returns a `WebView` component from `react-native-webview`npm package. Here the Pay3 modal will guide user through fiat payment services and deposit the payment to the app's Fiat account. &#x20;

**Parameters**

1. **requestId&#x20;**(Type string): App needs to generate a unique identifier for every checkout call. This id will be provided in the Javascript events and Webhooks callbacks. This id can be used by the App to identify and update state in App's backend. &#x20;
2. **user&#x20;**: User details can be passed to Pay3 in this object.&#x20;
   1. **email** (Type string): Provide valid email address of user. This data will be passed to partner service during the Fiat checkout flow. Payment partner may send mails to user updating them status of their transaction.
3. **payment** : This section provides is the amount payable by the user of your platform. It could be cost price of your digital asset user wishes to checkout.&#x20;
   1. **amount** (Type string): String representing currency amount in two decimal precision. The amount is provided separately for each supported currency.
   2. **name** (Type string): Name of the currency supported in the purchase flow. The name will be provided by Pay3 during Onboarding.  &#x20;
4. **userMessage** (Type string): Short meaningful name of the asset user is about to purchase. &#x20;

```javascript
const checkoutObj = {
  "requestId": requestId,
  "user": {
    "email": "user@email.address"
  },
  "payment": [
    {
      "amount": "20.25",
      "name": "brl_bz"
    },
    {
      "amount": "5.05",
      "name": "usd_usa"
    },
    {
      "amount": "4.00",
      "name": "gbp_gb"
    }
  ],
  "userMessage": "Sample Message"
};
// Opens Pay3 Buy modal
return (
    <>
      {pay3checkoutVisibleState? pay3.getCheckoutWebView(checkoutObj) : null}
    </>
);
```

***


[title] Pay3 React Native SDK
[path] /

Pay3 React Native SDK is a node module [@pay3/sdk-react-native ](https://www.npmjs.com/package/@pay3/sdk-react-native) that can be included within the mobile application. The sdk provides two-way communication with Pay3 webapp .&#x20;

Pay3 webapp is a versatile application that can handle various payment methods for your users. Pay3 publishes realtime events to mobile applications using Firebase Realtime database.&#x20;

![Pay3 Checkout Flow](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/KQN6tQg52nv8-Qm1P_gK__fiat-checkout-flow.png "Pay3 Checkout Flow")

***


[title] End User Flow - Crypto Checkout
[path] Untitled/

This feature allows you to accept payments in cryptocurrencies and stablecoins across popular chains such as Ethereum, Tron, Solana, Polygon, and Bitcoin.

User can do the payment using two methods:&#x20;

1\. Connect user's wallet like Metamask, Coinbase, Walletconnect etc and pay through the connected wallet.&#x20;

2\. Users can pay by using the QR code.

For reference, we will go over the flow of USDT Checkout on Polygon using QR code method.

1. User finishes the complete payment

- When the user initiates the payment, the user is presented with the screen which will comprise the amount, network and QR code and the fees.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/di5ypDwXXaMld9nB-Pon4_screenshot-2024-05-09-at-548-1.png" size="50" width="1680" height="2690" position="center" darkWidth="1680" darkHeight="2690" showCaption="false"}

- Once the user scans the QR code and the payment is done, the user indicates that the transfer is completed by using the 'I have completed this payment' button
- Upon confirmation, the transaction is processed and relevant status of the transaction is presented to the user along with the reference ID of the transaction.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-NrnErMLIQCF5aMRsMCXdw-20250829-052019.png" size="50" width="840" height="854" position="center" darkWidth="840" darkHeight="854" showCaption="false"}

2\. User makes partial payment

- When the user initiates the payment, the user is presented with the screen which will comprise the amount, network and QR code and the fees.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/F8lLoWompq0Mk1JwZDpvU_screenshot-2024-05-09-at-548-1.png" size="50" width="1680" height="2690" position="center" darkWidth="1680" darkHeight="2690" showCaption="false"}

- Incase the user now makes the partial payment and indicates that the transfer is completed by using the 'I have completed this payment' button, we will indicate to the user that they have only completed a partial payment. They will be given an option to finish the transaction by re-generating the QR code.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/q-egACaO3JG4QuYmkAzK4_underpaid-transaction-6.png" size="50" width="1694" height="2234" position="center" darkWidth="1694" darkHeight="2234" showCaption="false"}

- The user is shown the re-generated QR code with the updated amount which needs to be paid by the user.&#x20;

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/1aKyF46WACQqRxo6Thb0H_group-1000008647.png" size="50" width="840" height="1345" position="center" darkWidth="840" darkHeight="1345" showCaption="false"}

- Upon confirmation, the transaction is processed and relevant status of the transaction is presented to the user along with the reference ID of the transaction.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-NrnErMLIQCF5aMRsMCXdw-20250829-052019.png" size="50" width="840" height="854" position="center" darkWidth="840" darkHeight="854" showCaption="false"}

**Note:  BTC transactions involve longer confirmation times&#x20;**&#x63;ompared to other crypto payments. Because of Bitcoin’s inherent blockchain characteristics, users should expect delays before the payment is fully confirmed by the network. This longer processing time is normal and simply reflects the required number of blockchain confirmations.&#x20;

Hence, we take the user through a slightly different flow where a ‘Payment Initiated’ screen is shown, and the merchant is updated regarding the order status through a Webhook after we receive confirmation from the Bitcoin Network.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-I7Uqc2lNMCT1X0PjCIyEC-20250828-085628.png" size="50" width="1260" height="1281" position="center" darkWidth="1260" darkHeight="1281" showCaption="false"}

***



[title] End User Flows
[path] /

This section explains the key steps a user follows, from starting a transaction to completing the purchase. The flow highlights how tokens are credited or debited to the user’s account.

Sample UI screenshots are included to help visually understand each step of the user experience.

***


[title] End User Flow - Fiat Payout
[path] Untitled/

You can request payouts of Game rewards and other in-game assets using popular Fiat payment methods. For reference, we will go over the flow of Fiat Payout with the Bank Transfer method in Brazil:

1. When the payout flow starts, the user is presented with the screen which will comprise the First Name, Last Name, Fiat Amount, Document Type and Document ID

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/JAyK0kMr8UsM2IFZQidLD_group-1686554534.png" size="50" width="1688" height="2822" position="center" showCaption="false"}

2\. After user verifies the above details, the Full Name and Bank Account details are fetched from the last payin transaction and displayed to the user for his reference.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/5IoWUKF5rC5NPuj-2Nv1w_group-1686554525.png" size="50" width="1686" height="2826" position="center" showCaption="false"}

3\. After reviewing the details, the user is required to submit the transaction and the payout is initiated.

Note: Based on the partner and payment method, processing of payouts can take up to 90 seconds for instant payouts. For non-instant payouts, it will be processed during business banking hours.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/NCKNzdVmHXpG63ES9OF8-_group-1000008683.png" size="50" width="1688" height="1754" position="center" showCaption="false"}

***


[title] End User Flow - Crypto Payouts
[path] Untitled/

This feature allows you to pay out your users in cryptocurrencies and stablecoins across popular chains such as Ethereum, Tron, Solana, Polygon, and Bitcoin.

Users can receive payouts by going through the following steps:

1. All the required details for the payout such as Wallet Address, Token, Amount, and Chain are provided to us and displayed to the user.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-P5FLEkvXAMtyVspJdRu0J-20250829-051527.png" size="50" width="848" height="1500" position="center" darkWidth="848" darkHeight="1500" showCaption="false"}

2\. The user verifies all the information on the screen and submits the payout request. Upon confirmation, the transaction is processed, and the relevant status is displayed to the user along with the transaction reference ID.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-NrnErMLIQCF5aMRsMCXdw-20250829-052019.png" size="50" width="840" height="854" position="center" darkWidth="840" darkHeight="854" showCaption="false"}

***


[title] Update Your Webhook
[path] Pay3 API Documentation/

This API changes the current configured webhook for your payment notifications at Pay3's end.

:::ApiMethodV2
```json
{
  "name": "Update Your Webhook",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/webhook-url",
  "description": "Get balance for a Client ID",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "R_kjEOVWrgdjXK9y79KWL",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/fiat/webhook-url' \\\n--header 'access-token: ACCESS-TOKEN-IN-JWT' \\\n--header 'client-id: YOUR-CLIENT-ID' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"webhookUrl\": \"your-webhook-endpoint\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "R_kjEOVWrgdjXK9y79KWL"
  },
  "results": {
    "languages": [
      {
        "id": "-WPelU7C1GJ3RYSstvFCO",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"message\": \"Webhook endpoint updated successfully.\"\n}"
      },
      {
        "id": "nV086WqVdYra6yxpqPFIt",
        "language": "400",
        "customLabel": "",
        "code": "{\n    \"error\": {\n        \"code\": \"400\",\n        \"message\": \"Could not verify the client\"\n    }\n}"
      }
    ],
    "selectedLanguageId": "nV086WqVdYra6yxpqPFIt"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's Identifier",
        "": "Client id. Application's Identifier"
      }
    ],
    "bodyDataParameters": [
      {
        "name": "webhookUrl",
        "kind": "optional",
        "type": "string",
        "description": "Client's webhook URL endpoint to be configured",
        "": "Client's webhook URL endpoint to be configured"
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "update-your-webhook",
  "legacyHash": "doQI9gILV4-iR9zqY-57O"
}
```
:::

***


[title] Access Token
[path] Pay3 API Documentation/

# Get Access Token

This api returns access token that can be used in some of our API endpoints here.

**Important**: **Only call this API from server side** where the api-secret is well protected. &#x20;

:::ApiMethodV2
```json
{
  "name": "Get Access Token",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v1/auth/access-token",
  "description": "Get access token using api secret and client id",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "AZqOTJjcGUy11gU45LLMe",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/auth/access-token' \\\n--header 'api-secret: YOUR-API-SECRET' \\\n--header 'client-id: YOUR-CLIENT-ID'\n ",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "AZqOTJjcGUy11gU45LLMe"
  },
  "results": {
    "languages": [
      {
        "id": "kCj1U3BaA8qdjse8CmUlZ",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"accessToken\": \"ACCESS-TOKEN-IN-JWT\"\n}"
      },
      {
        "id": "MI7qeU6S41sbo6vz9368z",
        "language": "401",
        "customLabel": "",
        "code": "Unauthorized access"
      }
    ],
    "selectedLanguageId": "kCj1U3BaA8qdjse8CmUlZ"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "api-secret",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      },
      {
        "name": "client-id",
        "kind": "required",
        "type": "string",
        "description": "Client Id",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": true,
  "autoGeneratedAnchorSlug": "get-access-token-1",
  "legacyHash": "aVw21md4V3_tmSG0I0usw"
}
```
:::

***


[title] Create Crypto Payout Order
[path] Pay3 API Documentation/

This API creates a payout order to enable users to withdraw funds. It accepts `address`, `currency` ,`clientId` and `amount`.

This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Create Crypto Payout Order",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/crypto-payout/create-order",
  "description": "Create an order with payout details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "nyfSHp7J-NrsuqTH3FW7t",
        "language": "curl",
        "code": "curl --location 'https://api.dev.pay3.app/v1/client/crypto-payout/create-order' \\\n--header 'signature: {{signature}}' \\\n--header 'access-token: {dynamic-access-toke}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"clientId\": \"....\",\n    \"requestId\": \"a1d4a50e-5577-4581-a980-98b03bc76260\",\n    \"amount\": \"0.0001\",\n    \"currency\": \"btc_bitcointestnet\",\n    \"address\": \"0x5Fc0D01A67E756a15B8eb56937Fcb382637E8D2\",\n    \"mode\":\"returnUrl\"\n  }",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "nyfSHp7J-NrsuqTH3FW7t"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "mode=returnUrl\n{\n    \"token\": \"b5ed337a-e299-4f2b-aa76-50c68097d9c1\",\n    \"requestId\": \"a1d4a50e-5577-4581-a980-98b03bc76260\",\n    \"url\": \"https://host.pay3.app/pay3-sdk-ui-path\"\n}\n\nmode=createEstimate\n{\n    \"token\": \"a003d60c-d0ae-40e5-a7cb-2634ab607253\",\n    \"requestId\": \"a1d4a50e-5577-4581-a980-98b03bc76260\",\n    \"currency\": \"btc_bitcointestnet\",\n    \"address\": \"tb1q7sqtxktz3jle8evmfnnhv45s0maudwdtknmdqu\",\n    \"warning\": \"The btc_bitcointestnet balance (0.0031) is below the configured threshold (100.0000).\",\n    \"estimatedFees\": \"0.000066\",\n    \"estimatedNetAmount\": \"0.000034\"\n}",
        "customLabel": ""
      },
      {
        "id": "tIvoQbUSKGnrqallvNDVQ",
        "language": "401",
        "code": "{\n    error: {\n      code: '7001',\n      message: 'Order already exists for given requestId'\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "signature",
        "kind": "required",
        "type": "string",
        "description": "Signature generated with sha256 followed by base64 encoding. Check below section for more details",
        "children": []
      },
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by client application's backend. This will be passed in relevant events and webhooks from Pay3 to Application",
        "children": []
      },
      {
        "name": "address",
        "kind": "required",
        "type": "string",
        "description": "The address is the destination wallet address where the crypto token currency will be deposited after the payout is processed. (User's wallet address should be passed in this)",
        "": "The address is the destination wallet address where the crypto token currency will be deposited after the payout is processed. (User's wallet address should be passed in this)"
      },
      {
        "name": "currency",
        "kind": "required",
        "type": "string",
        "description": "The currency is Pay3's unique string ID denoting the token that needs to be purchased. Example value are btc_bitcoin, usdt_polygon, uni_eth. "
      },
      {
        "name": "amount",
        "kind": "required",
        "type": "string",
        "description": "The amount in ethereum / btc user needs to pay. ",
        "": "The amount in ethereum / btc user needs to pay. "
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "mode",
        "kind": "optional",
        "type": "string",
        "description": "The supported values for mode are returnUrl, createEstimate, and default.\n\nreturnUrl: API response includes an additional field token, requestId and url.\nThis URL provides a direct checkout page link where users can complete their crypto payment through a hosted frontend flow.\n\ncreateEstimate: API returns a token and requestId.\nThese values must be passed to the Execute Crypto Payout Order API to complete the payout. This flow is fully backend-driven and does not involve any frontend or UI.",
        "": "The supported values for mode are returnUrl, createEstimate, and default.\n\nreturnUrl: API response includes an additional field token, requestId and url.\nThis URL provides a direct checkout page link where users can complete their crypto payment through a hosted frontend flow.\n\ncreateEstimate: API returns a token and requestId.\nThese values must be passed to the Execute Crypto Payout Order API to complete the payout. This flow is fully backend-driven and does not involve any frontend or UI."
      },
      {
        "name": "callbackUrl",
        "kind": "optional",
        "type": "string",
        "description": "Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter data query parameter will be added to the url. ",
        "": "callbackUrl"
      },
      {
        "name": "sponsorFee",
        "kind": "optional",
        "type": "boolean",
        "description": "When sponsorFee is set to true, the exact amount is sent to the destination address (user's address) without deducting fees.",
        "": "When sponsorFee is set to true, the exact amount is sent to the destination address (user's address) without deducting fees."
      },
      {
        "name": "userId",
        "kind": "optional",
        "type": "string",
        "description": "Pass any string for the user (uniqueId) to identify and map the orders against the user. This can be same value which you are using in your application to uniquely identify the users.",
        "": "Pass any string for the user (uniqueId) to identify and map the orders against the user. This can be same value which you are using in your application to uniquely identify the users."
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "response": [
    {
      "name": "token",
      "kind": "optional",
      "type": "string",
      "description": "Returned as part of the payout order creation. This value authorizes and links the execution request to the original payout order. \n\nFor mode = createEstimate\nThis token must be passed to the Execute Crypto Payout Order API to finalize and trigger the payout. "
    },
    {
      "name": "requestId",
      "kind": "optional",
      "type": "string",
      "description": "This is the same value of requestId passed while calling this API",
      "children": []
    },
    {
      "name": "url",
      "kind": "optional",
      "type": "string",
      "description": "(Returned only when mode = returnUrl)\nA direct checkout page link where users can complete their crypto payment through a hosted frontend page.",
      "children": []
    },
    {
      "name": "currency",
      "kind": "optional",
      "type": "string",
      "description": "(Returned for mode = createEstimate)\nThe currency string representing the token selected for payout. Example values include btc_bitcoin, usdt_polygon etc. Same as passed in the request.",
      "children": []
    },
    {
      "name": "address",
      "kind": "optional",
      "type": "string",
      "description": "(Returned for mode = createEstimate)\nThe destination wallet address where the payout is intended to be processed. Same as passed in the request.",
      "children": []
    },
    {
      "name": "warning",
      "kind": "optional",
      "type": "string",
      "description": "May provide additional information or caution related to the payout session, eg. Payout wallet balance is lesser than threshold. \n",
      "children": []
    },
    {
      "name": "estimatedFees",
      "kind": "optional",
      "type": "string",
      "description": "(Returned for mode = createEstimate)\nThe estimated gas/network fees in \"currency\" value, required to complete the payout.",
      "children": []
    },
    {
      "name": "estimatedNetAmount",
      "kind": "optional",
      "type": "string",
      "description": "(Returned for mode = createEstimate)\nThe estimated net amount in \"currency\" value, the user will receive after deducting gas fees and any applicable charges.",
      "children": []
    }
  ],
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "create-crypto-payout-order",
  "legacyHash": "sqj7sRsDC04r4g-8bBx8B"
}
```
:::

## Signature Generation

The request for creating payout order requires a header `signature`. This can be generated using following javascript code snippet.&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const address = "destination-wallet-address";
const currency = "currency-id";
const amount =  "0.02";
const requestId = "Order-Id-Generated-By-Application";

const getSignature = (secretKey, address, currency, amount, requestId) => {
    // Prepare the string to sign in same format. 
    const stringToSign = 'address=' + address + '&currency=' + currency + '&amount=' + amount + '&requestId=' + requestId;
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, address, currency, amount, requestId);

```

***


[title] Postman API Collection
[path] Pay3 API Documentation/

The Pay3 Postman API Collection is your gateway to seamlessly test and integrate our suite of payment orchestration APIs. Explore, test, and build robust payment solutions for your business with ease.

## Getting Started

### Step 1: Access the API Collection

1. **Download the Collection:**
   Click here to download the [Pay3 API Collection](https://documenter.getpostman.com/view/47708127/2sBXcAH2WE)

### Step 2: Set Up Your Environment

1. **Configure Variables in Postman:**
   - API Secret: Add your unique API key to the environment variables.
   - Client ID: Add your unique Client ID key to the environment variables.
   - Endpoint: Set up the sandbox or production URL.

## &#x20;Need Help?

If you encounter any issues or have questions:

- **Contact Support:** [help@pay3.money](mailto\:help@pay3.money)&#x20;

***


[title] Get Webhook
[path] Pay3 API Documentation/

This API returns the current configured webhook for your payment notifications at Pay3's end.&#x20;

:::ApiMethodV2
```json
{
  "name": "Get Webhook",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v1/client/webhook-url",
  "description": "Get balance for a Client ID",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "R_kjEOVWrgdjXK9y79KWL",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/fiat/webhook-url' \\\n--header 'access-token: ACCESS-TOKEN-IN-JWT'\n--header 'client-id: YOUR-CLIENT-ID'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "R_kjEOVWrgdjXK9y79KWL"
  },
  "results": {
    "languages": [
      {
        "id": "-WPelU7C1GJ3RYSstvFCO",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"webhookUrl\": \"your-webhook-endpoint\"\n}"
      },
      {
        "id": "nV086WqVdYra6yxpqPFIt",
        "language": "400",
        "customLabel": "",
        "code": "{\n    \"error\": {\n        \"code\": \"400\",\n        \"message\": \"Could not verify the client\"\n    }\n}"
      }
    ],
    "selectedLanguageId": "nV086WqVdYra6yxpqPFIt"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's Identifier",
        "": "Client id. Application's Identifier"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-webhook",
  "legacyHash": "HyIBWDa61Nu8ecXMmt_0E"
}
```
:::

***


[title] Get Balance
[path] Pay3 API Documentation/

This API returns balance for accounts configured for checkout and payout transactions. A list of balance objects is returned are for a given Client ID. If for a given currency, there are multiple partners configured based on payment methods, the response will contain balances for those multiple partners.&#x20;

:::ApiMethodV2
```json
{
  "name": "Get Balance",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v1/client/fiat/balance",
  "description": "Get balance for a Client ID",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "R_kjEOVWrgdjXK9y79KWL",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/fiat/balance?clientId=YOUR-CLIENT-ID' \\\n--header 'access-token: ACCESS-TOKEN-IN-JWT'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "R_kjEOVWrgdjXK9y79KWL"
  },
  "results": {
    "languages": [
      {
        "id": "-WPelU7C1GJ3RYSstvFCO",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"balances\": [\n        {\n            \"currencyId\": \"brl_bz\",\n            \"currency\": \"BRL\",\n            \"balance\": \"6348.22\",\n            \"partner\": \"partnerId\"\n        }\n    ]\n}"
      },
      {
        "id": "nV086WqVdYra6yxpqPFIt",
        "language": "400",
        "customLabel": "",
        "code": "{\n    \"error\": {\n        \"code\": \"400\",\n        \"message\": \"Could not verify the client\"\n    }\n}"
      }
    ],
    "selectedLanguageId": "-WPelU7C1GJ3RYSstvFCO"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client ID",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-balance",
  "legacyHash": "ScY8BfqTc_CgJdpVCQO3Y"
}
```
:::

***


[title] Execute Fiat Settlement - Submit Invoice
[path] Pay3 API Documentation/

This API is used to submit invoice details for a specific fiat order and subsequently trigger the settlement process.

This API is required only for certain geographies or currencies where merchants must submit invoice details for each order to comply with local regulatory and compliance requirements.

Whether invoice submission is required for your integration will be communicated by the Pay3 team during the integration process.

This API requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Fiat Settlement - Submit Invoice",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/client/fiat-settlement/submit-invoice",
  "description": "Submit an Invoice for any fiat order using the same requestId which was used during the order creation.",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "nyfSHp7J-NrsuqTH3FW7t",
        "language": "curl",
        "code": "curl --location 'https://api.pprod.pay3.app/v1/client/fiat-settlement/submit-invoice' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'access-token: eyJraWQiOiIxYmI5NjA1YzM2ZVRCWkJMOH' \\\n--data '{\n    \"requestId\": \"2544743810\",\n    \"clientId\": \"82e024d1-8e43-4252-88d4-f3222e4f113b\",\n     \"countryOfOrigin\": \"USA\",\n    \"importerName\": \"John\",\n    \"importerAddress\": {\n        \"address\": \"321 Elm Street, Suite 3\",\n        \"country\": \"USA\",\n        \"city\": \"Los Angeles, CA\",\n        \"pinCode\": \"90401\"\n    },\n    \"billerName\": \"Pay3\",\n    \"billerAddress\": {\n        \"address\": \"123 Space Center Blvd\",\n        \"country\": \"USA\",\n        \"city\": \"Houston\",\n        \"pinCode\": \"77058\"\n    },\n    \"invoiceDate\": \"2027-01-01\",\n        \"orderSno\": \"123123\",\n     \"invoiceTotal\": \"400.00\",\n        \"invoiceNumber\": \"234234\",\n           \"items\": [\n        {\n            \"itemDescription\": \"Shoes\",\n            \"price\": \"250.00\",\n            \"quantity\": \"1\",\n            \"taxPercentage\": \"0\",\n            \"taxAmount\": \"0.00\",\n            \"itemTotalPrice\": \"250.00\"\n        },\n        {\n            \"itemDescription\": \"Watch\",\n            \"price\": \"150.00\",\n            \"quantity\": \"1\",\n            \"taxPercentage\": \"0\",\n            \"taxAmount\": \"0.00\",\n            \"itemTotalPrice\": \"150.00\"\n        }\n    ]\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "nyfSHp7J-NrsuqTH3FW7t"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "{\n    \"id\": \"237690bb-f311-4a3e-9fbe-d36711ad5bfa\",\n    \"status\": \"REVIEW_QUEUED\",\n    \"requestMetadata\": {\n        \"clientId\": \"82e024d1-8e43-4252-88d4-f3222e4f113b\",\n        \"requestId\": \"2544743810\",\n        \"countryOfOrigin\": \"USA\",\n        \"importerName\": \"John\",\n        \"importerAddress\": {\n            \"address\": \"321 Elm Street, Suite 3\",\n            \"city\": \"Los Angeles, CA\",\n            \"country\": \"USA\",\n            \"pinCode\": \"90401\"\n        },\n        \"billerName\": \"Pay3\",\n        \"billerAddress\": {\n            \"address\": \"123 Space Center Blvd\",\n            \"city\": \"Houston\",\n            \"country\": \"USA\",\n            \"pinCode\": \"77058\"\n        },\n        \"invoiceDate\": \"2027-01-01\",\n        \"invoiceTotal\": \"400.00\",\n        \"orderSno\": \"123123\",\n        \"invoiceNumber\": \"234234\",\n        \"items\": [\n            {\n                \"itemDescription\": \"Shoes\",\n                \"hsCode\": null,\n                \"price\": \"250.00\",\n                \"quantity\": \"1\",\n                \"taxPercentage\": \"0\",\n                \"taxAmount\": \"0.00\",\n                \"itemTotalPrice\": \"250.00\"\n            },\n            {\n                \"itemDescription\": \"Watch\",\n                \"hsCode\": null,\n                \"price\": \"150.00\",\n                \"quantity\": \"1\",\n                \"taxPercentage\": \"0\",\n                \"taxAmount\": \"0.00\",\n                \"itemTotalPrice\": \"150.00\"\n            }\n        ]\n    },\n    \"createdTs\": \"2026-07-08T10:42:51.307292+00:00\",\n    \"updatedTs\": \"2026-07-08T10:42:51.307292+00:00\"\n}",
        "customLabel": ""
      },
      {
        "id": "tIvoQbUSKGnrqallvNDVQ",
        "language": "401",
        "code": "{\n    \"code\": \"7001\",\n    \"error\": {\n        \"code\": \"500\",\n        \"message\": \"No route found for subscription\"\n    }\n}\n\n{\n    \"code\": \"7001\",\n    \"error\": {\n        \"code\": \"500\",\n        \"message\": \"Invalid value for interval: DAILY1\"\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application",
        "": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application"
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "": "required"
      },
      {
        "name": "countryOfOrigin",
        "kind": "required",
        "type": "string",
        "description": "This parameter accepts a string for Country of origin.",
        "": "required"
      },
      {
        "name": "importerName",
        "kind": "required",
        "type": "string",
        "description": "Name of the importer/end user.\n",
        "": "required"
      },
      {
        "name": "importerAddress",
        "kind": "required",
        "type": "object",
        "description": "Address of the importer/end user. This object accepts following params:-\n",
        "": "required",
        "children": [
          {
            "name": "address",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "country",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "city",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "pinCode",
            "kind": "optional",
            "type": "string",
            "description": ""
          }
        ],
        "schema": [
          {
            "name": "address",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "country",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "city",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "pinCode",
            "kind": "optional",
            "type": "string",
            "description": ""
          }
        ]
      },
      {
        "name": "billerName",
        "kind": "required",
        "type": "string",
        "description": "Name of the Merchant. Eg :- \"ABC Private Limited\"",
        "": "required"
      },
      {
        "name": "billerAddress",
        "kind": "required",
        "type": "object",
        "description": "Address of the Merchant. This object accepts following params :- ",
        "": "required",
        "children": [
          {
            "name": "address",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "country",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "city",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "pinCode",
            "kind": "optional",
            "type": "string",
            "description": ""
          }
        ],
        "schema": [
          {
            "name": "address",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "country",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "city",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "pinCode",
            "kind": "optional",
            "type": "string",
            "description": ""
          }
        ]
      },
      {
        "name": "invoiceDate",
        "kind": "required",
        "type": "string",
        "description": "Date of the invoice",
        "": "required"
      },
      {
        "name": "invoiceTotal",
        "kind": "required",
        "type": "integer",
        "description": "This parameter is the sum of all the \"itemTotalPrice\" from the \"items\" object.",
        "": "required"
      },
      {
        "name": "orderSno",
        "kind": "required",
        "type": "string",
        "description": "Order Serial number.",
        "": "required"
      },
      {
        "name": "invoiceNumber",
        "kind": "required",
        "type": "string",
        "description": "The invoice number of the order.",
        "": "required"
      },
      {
        "name": "items",
        "kind": "required",
        "type": "object",
        "description": "This parameter accepts array of objects. Using this multiple details can be submitted for different item. \nEach object inside this accepts following parameters :- \n",
        "": "This parameter accepts array of objects. Using this multiple details can be submitted for different item. \nEach object inside this accepts following parameters :- \n",
        "children": [
          {
            "name": "itemDescription",
            "kind": "optional",
            "type": "string",
            "description": "Small Description of the item. Eg :- \"shoes\" , \"watch\" etc."
          },
          {
            "name": "price",
            "kind": "optional",
            "type": "integer",
            "description": "Price of the Item."
          },
          {
            "name": "quantity",
            "kind": "optional",
            "type": "integer",
            "description": "Quantity of the item."
          },
          {
            "name": "taxPercentage",
            "kind": "optional",
            "type": "string",
            "description": "Tax percentage applicable on the item."
          },
          {
            "name": "taxAmount",
            "kind": "optional",
            "type": "integer",
            "description": "Calculated tax amount as per the \"taxPercentage\"."
          },
          {
            "name": "itemTotalPrice",
            "kind": "optional",
            "type": "integer",
            "description": "Total Price of the item inclusive of tax."
          }
        ],
        "schema": [
          {
            "name": "itemDescription",
            "kind": "optional",
            "type": "string",
            "description": "Small Description of the item. Eg :- \"shoes\" , \"watch\" etc."
          },
          {
            "name": "price",
            "kind": "optional",
            "type": "integer",
            "description": "Price of the Item."
          },
          {
            "name": "quantity",
            "kind": "optional",
            "type": "integer",
            "description": "Quantity of the item."
          },
          {
            "name": "taxPercentage",
            "kind": "optional",
            "type": "string",
            "description": "Tax percentage applicable on the item."
          },
          {
            "name": "taxAmount",
            "kind": "optional",
            "type": "integer",
            "description": "Calculated tax amount as per the \"taxPercentage\"."
          },
          {
            "name": "itemTotalPrice",
            "kind": "optional",
            "type": "integer",
            "description": "Total Price of the item inclusive of tax."
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "fiat-settlement-submit-invoice",
  "legacyHash": "706EUjTSNEFgKfL4kKq4S"
}
```
:::

***


[title] SDK Errors
[path] /

008.5Pay3 SDK provides error states that can be access from the Application.

# Initialisation Errors

| Code | Message                | Description                                                                                                                     |
| ---- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| 1001 | Failed to initialize   | Error connecting with services while initializing the client-side wallet.&#xA;Make sure the clientId is enabled and configured. |
| 1002 | Domain not whitelisted | To enable the wallet in a new domain, please contact us.                                                                        |
| 1003 | Not initialized        | This error can happen when the application uses SDK components and features before initialization.                              |

# Transaction Errors

| Code           | Message                     | Description                                                                                                                                                           |
| -------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 7001           | Unable to fetch buy offer   | Error fetching suitable offer while initialising the transaction. This can happen if the amount doesn't match limit checks, payment method and country not supported. |
|                |                             |                                                                                                                                                                       |
| 9002           | No route found for checkout | Currently there is no partner supporting the selected payment method.                                                                                                 |
|                |                             |                                                                                                                                                                       |
| 9003           | Payment Cancelled           | Payment cancelled during the checkout process.                                                                                                                        |
|                |                             |                                                                                                                                                                       |
| 9004           | Failure with partner        | Error occurred while the payment was processed by the payment partner.                                                                                                |
| 9004.1         | Failure with partner        | User limit exceeded.                                                                                                                                                  |
| 9004.2         | Failure with partner        | Error trying to validate tax ID document.                                                                                                                             |
| 9004.3         | Failure with partner        | Invalid transaction ID.                                                                                                                                               |
| 9004.4         | Failure with partner        | Transaction is invalid.                                                                                                                                               |
|                |                             |                                                                                                                                                                       |
| 9005           | Payment Declined            | Downstream payment partner declined the transaction.                                                                                                                  |
| 9005.1         | Payment Declined            | TaxID doesn’t exist.                                                                                                                                                  |
| 9005.2         | Payment Declined            | CPF query for minors blocked in compliance with the General Data Protection Law - LGPD.                                                                               |
| 9005.3         | Payment Declined            | TaxID pending regularisation.                                                                                                                                         |
| 9005.4         | Payment Declined            | TaxID suspended.                                                                                                                                                      |
| 9005.5         | Payment Declined            | TaxID canceled by local authority.                                                                                                                                    |
| 9005.6         | Payment Declined            | Impeached TaxID.                                                                                                                                                      |
| 9005.7         | Payment Declined            | Transaction declined for unknown reason.                                                                                                                              |
| 9005.8         | Payment Declined            | Payment rejected by risk analysis.                                                                                                                                    |
| 9005.9         | Payment Declined            | Unauthorized. Invalid security code.                                                                                                                                  |
| 9005.10        | Payment Declined            | Unauthorized. Restricted card.                                                                                                                                        |
| 9005.11        | Payment Declined            | Unauthorized. Card expired.                                                                                                                                           |
| 9005.12        | Payment Declined            | Unauthorized. The card does not belong to the payment network.                                                                                                        |
| 9005.13        | Payment Declined            | Unauthorized. Check the situation of the store with the issuer.                                                                                                       |
| 9005.14        | Payment Declined            | There is an issue with this card. Please contact the issuer.                                                                                                          |
| 9005.15        | Payment Declined            | Transaction not authorized. Please try again.                                                                                                                         |
| 9005.16        | Payment Declined            | Invalid/Incorrect Destination Account.                                                                                                                                |
| 9005.17        | Payment Declined            | Insufficient funds in Payout account.                                                                                                                                 |
| 9005.18        | Payment Declined            | User payment declined due to source account mismatch.                                                                                                                 |
| 9005.19        | Payment Declined            | Missing Destination Account.                                                                                                                                          |
| 9005.20        | Payment Declined            | No Payin prior to Payout.                                                                                                                                             |
| 9005.21        | Payment Declined            | Payment was not completed on time.                                                                                                                                    |
| 9005.22        | Payment Declined            | Transaction failed at processor end due to risk control.Please try using a different payment method/card.                                                             |
| 9005.23        | Payment Declined            | Account is invalid or not active.                                                                                                                                     |
| 9005.24        | Payment Declined            | User information entered is invalid.                                                                                                                                  |
| 9005.25        | Payment Declined            | System is busy, please try again later.                                                                                                                               |
| 9005.26        | Payment Declined            | Request timed out.                                                                                                                                                    |
| 9005.27        | Payment Declined            | Unknown error.                                                                                                                                                        |
| 9005.28        | Payment Declined            | The signature verify failed.                                                                                                                                          |
| 9005.29        | Payment Declined            | Invalid merchant.                                                                                                                                                     |
| 9005.30        | Payment Declined            | Invalid merchant APP.                                                                                                                                                 |
| 9005.31        | Payment Declined            | Invalid parameter - input parameter field length does not meet the requirement.                                                                                       |
| 9005.32        | Payment Declined            | Amount is incorrect.                                                                                                                                                  |
| 9005.33        | Payment Declined            | Invalid country, please refer to Supported Country/Region and Currency.                                                                                               |
| 9005.34        | Payment Declined            | Invalid currency, please refer to Supported Country/Region and Currency.                                                                                              |
| 9005.35        | Payment Declined            | Invalid contract, please check contract validity.                                                                                                                     |
| 9005.36        | Payment Declined            | The payment method does not exist; please change to other payment methods.                                                                                            |
| 9005.37        | Payment Declined            | The payment method is temporarily unavailable; please change to another payment method.                                                                               |
| 9005.38        | Payment Declined            | Maximum amount limit.                                                                                                                                                 |
| 9005.39        | Payment Declined            | Amount limit.                                                                                                                                                         |
| 9005.40        | Payment Declined            | Duplicate order.                                                                                                                                                      |
| 9005.41        | Payment Declined            | The merchant is not onboarded; please complete merchant onboarding                                                                                                    |
| 9005.42        | Payment Declined            | Payment is being processed; please try again later.                                                                                                                   |
| 9005.43        | Payment Declined            | Invalid ledger participant.                                                                                                                                           |
| 9005.44        | Payment Declined            | Order closed.                                                                                                                                                         |
| 9005.45        | Payment Declined            | Insufficient Balance.                                                                                                                                                 |
| 9005.46        | Payment Declined            | OTP verification exceeds limit.                                                                                                                                       |
| 9005.47        | Payment Declined            | OTP verification failed.                                                                                                                                              |
| 9005.48        | Payment Declined            | Verification times exceeded.                                                                                                                                          |
| 9005.49        | Payment Declined            | Barcode refresh limit.                                                                                                                                                |
| 9005.50        | Payment Declined            | Barcode refresh failed.                                                                                                                                               |
| 9005.51        | Payment Declined            | Invalid card number.                                                                                                                                                  |
| 9005.52        | Payment Declined            | Invalid card number validity period.                                                                                                                                  |
| 9005.53        | Payment Declined            | Invalid cardholder name.                                                                                                                                              |
| 9005.54        | Payment Declined            | Invalid CVV.                                                                                                                                                          |
| 9005.55        | Payment Declined            | Unsupported card.                                                                                                                                                     |
| 9005.56        | Payment Declined            | Invalid phone number.                                                                                                                                                 |
| 9005.57        | Payment Declined            | Invalid UPI.                                                                                                                                                          |
| 9005.58        | Payment Declined            | Pin verification exceeds limit.                                                                                                                                       |
| 9005.59        | Payment Declined            | Invalid PIN.                                                                                                                                                          |
| 9005.60        | Payment Declined            | Invalid bank card number.                                                                                                                                             |
| 9005.61        | Payment Declined            | Invalid ID number.                                                                                                                                                    |
| 9005.62        | Payment Declined            | Invalid Email.                                                                                                                                                        |
| 9005.63        | Payment Declined            | Invalid document.                                                                                                                                                     |
| 9005.64        | Payment Declined            | Invalid TC Kimlik No.                                                                                                                                                 |
| 9005.65        | Payment Declined            | Invalid date format.                                                                                                                                                  |
| 9005.66        | Payment Declined            | Invalid payee name.                                                                                                                                                   |
| 9005.67        | Payment Declined            | Invalid remark.                                                                                                                                                       |
| 9005.68        | Payment Declined            | Invalid CNIC.                                                                                                                                                         |
| 9005.69        | Payment Declined            | Payment Failed.                                                                                                                                                       |
| 9005.70        | Payment Declined            | Account locked/frozen.                                                                                                                                                |
| 9005.71        | Payment Declined            | User canceled third-party payment.                                                                                                                                    |
| 9005.72        | Payment Declined            | Your payment was declined due to authentication failure. Please try using a different card or contact your issuer for more detail.                                    |
| 9005.73        | Payment Declined            | Authorization expired.                                                                                                                                                |
| 9005.74        | Payment Declined            | Authorization failed or does not exist.                                                                                                                               |
| 9005.75        | Payment Declined            | Merchant blacklist blocking.                                                                                                                                          |
| 9005.76        | Payment Declined            | Request rejected by third party.                                                                                                                                      |
| 9005.77        | Payment Declined            | The order does not exist.                                                                                                                                             |
| 9005.78        | Payment Declined            | Refund failed; the payment method does not support refund.                                                                                                            |
| 9005.79        | Payment Declined            | Invalid refund order number.                                                                                                                                          |
| 9005.80        | Payment Declined            | The customer bank account has been closed.                                                                                                                            |
| 9005.81        | Payment Declined            | The country of the business address provided does not match the account country.                                                                                      |
| 9005.82        | Payment Declined            | Account country change requires additional steps.                                                                                                                     |
| 9005.83        | Payment Declined            | Some account information mismatches with one another.                                                                                                                 |
| 9005.84        | Payment Declined            | The bank account number provided is invalid.                                                                                                                          |
| 9005.85        | Payment Declined            | The specified amount is greater than the minimum amount allowed                                                                                                       |
| 9005.86        | Payment Declined            | The specified amount is less than the minimum amount allowed                                                                                                          |
| 9005.87        | Payment Declined            | The bank account provided cannot be used to charge.                                                                                                                   |
| 9005.88        | Payment Declined            | The customer account cannot be used with the payment method                                                                                                           |
| 9005.89        | Payment Declined            | This card has been declined too many times.                                                                                                                           |
| 9005.90        | Payment Declined            | The customer account has insufficient funds to cover this payment.                                                                                                    |
| 9005.91        | Payment Declined            | An error occurred when processing the card.                                                                                                                           |
| 9005.92        | Payment Declined            | Too many requests hit the API too quickly.                                                                                                                            |
| 9005.93        | Payment Declined            | The bank routing number provided is invalid.                                                                                                                          |
| 9005.94        | Payment Declined            | The shipping address information cannot be used to accurately determine tax rates.                                                                                    |
| 9005.95        | Payment Declined            | Customer's payment instrument is inactive.                                                                                                                            |
| 9005.96        | Payment Declined            | Customer's payment instrument was blocked by the network                                                                                                              |
| 9005.97        | Payment Declined            | Request session is timed out. Kindly retry after sometime.                                                                                                            |
| 9005.98        | Payment Declined            | A network infrastructure error was detected                                                                                                                           |
| 9005.99        | Payment Declined            | Transaction declined due to invalid issuer.                                                                                                                           |
| 9005.100       | Payment Declined            | Transaction failed due to host timeout.                                                                                                                               |
| 9005.101       | Payment Declined            | There is some temporary issue from the bank side.                                                                                                                     |
| 9005.102       | Payment Declined            | Transaction failed due to system error.                                                                                                                               |
| 9005.103       | Payment Declined            | System error was detected at payment processor end                                                                                                                    |
| 9005.104       | Payment Declined            | Transaction failed due to unknown error.                                                                                                                              |
| 9005.105       | Payment Declined            | Problem occurred while getting terminal                                                                                                                               |
| 9005.106       | Payment Declined            | Transaction failed due to acquirer not participating.                                                                                                                 |
| 9005.107       | Payment Declined            | Transaction failed due to invalid card type.                                                                                                                          |
| 9005.108       | Payment Declined            | The server encountered an unexpected error while processing the request.                                                                                              |
| 9005.109       | Payment Declined            | Transaction rejected at NPCI. Please contact the acquirer.                                                                                                            |
| 9005.110       | Payment Declined            | There is some network issue from the bank side.                                                                                                                       |
| 9005.111       | Payment Declined            | Invalid card status for the provided card details.                                                                                                                    |
| 9005.112       | Payment Declined            | Transaction declined because service is not available.                                                                                                                |
| 9005.113       | Payment Declined            | Issuer bank did not respond on time.                                                                                                                                  |
| 9005.114       | Payment Declined            | Issuer bank or payment service provider declined the transaction.                                                                                                     |
| 9005.115       | Payment Declined            | Payment service provider declined the transaction                                                                                                                     |
| 9005.116       | Payment Declined            | Customer has exceeded the withdrawal amount limit.                                                                                                                    |
| 9005.117       | Payment Declined            | Card is restricted or not valid.                                                                                                                                      |
| 9005.118       | Payment Declined            | Transaction declined because of violation of law.                                                                                                                     |
| 9005.119       | Payment Declined            | Transaction is not captured.                                                                                                                                          |
| 9005.120       | Payment Declined            | Transaction failed due to various reasons (invalid mpin, user connectivity issue).                                                                                    |
| 9005.121       | Payment Declined            | Transaction declined because of suspected fraud.                                                                                                                      |
| 9005.122       | Payment Declined            | User has exceeded daily limit of transferring funds.                                                                                                                  |
| 9005.123       | Payment Declined            | Transaction declined because of blocked account.                                                                                                                      |
| 9005.124       | Payment Declined            | Transaction failed as the authentication failed at bank end.                                                                                                          |
| 9005.125       | Payment Declined            | The request the client made is incorrect or corrupt.                                                                                                                  |
| 9005.126       | Payment Declined            | Bank unable to authorize the transaction.                                                                                                                             |
| 9005.127       | Payment Declined            | Customer has exceeded the withdrawal count limit.                                                                                                                     |
| 9005.128       | Payment Declined            | Transaction declined as the session got expired for this transaction.                                                                                                 |
| 9005.129       | Payment Declined            | Transaction declined due to risk.                                                                                                                                     |
| 9005.130       | Payment Declined            | Customer account is closed.                                                                                                                                           |
| 9005.131       | Payment Declined            | Transaction declined as the card is expired or incorrect expiry date.                                                                                                 |
| 9005.132       | Payment Declined            | Transaction not permitted to cardholder.                                                                                                                              |
| 9005.133       | Payment Declined            | Amount exceeded the authorized merchant limit.                                                                                                                        |
| 9005.134       | Payment Declined            | Inactive card or card not authorized for card not present transaction.                                                                                                |
| 9005.135       | Payment Declined            | Transaction not permitted to cardholder.                                                                                                                              |
| 9005.136       | Payment Declined            | Customer has exceeded the withdrawal frequency limit.                                                                                                                 |
| 9005.137       | Payment Declined            | Transaction declined because of blocked account/card.                                                                                                                 |
| 9005.138       | Payment Declined            | Transaction daily limit exceeded.                                                                                                                                     |
| 9005.139       | Payment Declined            | This transaction has been declined/canceled by the user.                                                                                                              |
| 9005.140       | Payment Declined            | Transaction exceeds credit card limit.                                                                                                                                |
| 9005.141       | Payment Declined            | PSP/Bank server downtime. Kindly retry after sometime.                                                                                                                |
| 9005.142       | Payment Declined            | User is not authorized to perform this action. Reach out to issuer bank.                                                                                              |
| 9005.143       | Payment Declined            | Transaction declined because it exceeds risk threshold.                                                                                                               |
| 9005.144       | Payment Declined            | Customer entered incorrect card number details.                                                                                                                       |
| 9005.145       | Payment Declined            | Retry the transaction.                                                                                                                                                |
| 9005.146       | Payment Declined            | This PSP is not allowed to initiate this payment.                                                                                                                     |
| 9005.147       | Payment Declined            | Transaction amount limit exceeded.                                                                                                                                    |
| 9005.148       | Payment Declined            | Some of the details related to the transaction are missing.                                                                                                           |
| 9005.149       | Payment Declined            | Transaction is not allowed by bank.                                                                                                                                   |
| 9005.150       | Payment Declined            | PSP server downtime. Kindly retry after sometime.                                                                                                                     |
| 9005.151       | Payment Declined            | User's phone number is not registered to the bank.                                                                                                                    |
| 9005.152       | Payment Declined            | Invalid Request.                                                                                                                                                      |
| 9005.153       | Payment Declined            | Transaction cost or currency not supplied.                                                                                                                            |
| 9005.154       | Payment Declined            | Cart ID not set.                                                                                                                                                      |
| 9005.155       | Payment Declined            | Invalid store ID.                                                                                                                                                     |
| 9005.156       | Payment Declined            | Invalid transaction mode.                                                                                                                                             |
| 9005.157       | Payment Declined            | Card expiry not supplied.                                                                                                                                             |
| 9005.158       | Payment Declined            | Card start date not supplied.                                                                                                                                         |
| 9005.159       | Payment Declined            | Card issue number not supplied.                                                                                                                                       |
| 9005.160       | Payment Declined            | Card number not supplied.                                                                                                                                             |
| 9005.161       | Payment Declined            | Invalid card security code (CVV).                                                                                                                                     |
| 9005.162       | Payment Declined            | Card security code (CVV) not supplied.                                                                                                                                |
| 9005.163       | Payment Declined            | Name not valid/not supplied.                                                                                                                                          |
| 9005.164       | Payment Declined            | Address not valid/not supplied.                                                                                                                                       |
| 9005.165       | Payment Declined            | Country not valid/not supplied.                                                                                                                                       |
| 9005.166       | Payment Declined            | IP address not valid/not supplied.                                                                                                                                    |
| 9005.167       | Payment Declined            | Card/Currency/Class combination not supported.                                                                                                                        |
| 9005.168       | Payment Declined            | Invalid transaction reference.                                                                                                                                        |
| 9005.169       | Payment Declined            | Amount differs from original.                                                                                                                                         |
| 9005.170       | Payment Declined            | Currency differs from original.                                                                                                                                       |
| 9005.171       | Payment Declined            | Original transaction not authorised.                                                                                                                                  |
| 9005.172       | Payment Declined            | Original transaction already voided.                                                                                                                                  |
| 9005.173       | Payment Declined            | Original transaction mismatch.                                                                                                                                        |
| 9005.174       | Payment Declined            | Invalid start date.                                                                                                                                                   |
| 9005.175       | Payment Declined            | Card details differ from original.                                                                                                                                    |
| 9005.176       | Payment Declined            | Not authorised.                                                                                                                                                       |
| 9005.177       | Payment Declined            | Original transaction cannot be voided.                                                                                                                                |
| 9005.178       | Payment Declined            | Cancelled.                                                                                                                                                            |
| 9005.179       | Payment Declined            | No response.                                                                                                                                                          |
| 9005.180       | Payment Declined            | Unable to refund.                                                                                                                                                     |
| 9005.181       | Payment Declined            | Previous transaction is on hold.                                                                                                                                      |
| 9005.182       | Payment Declined            | Invalid transaction class.                                                                                                                                            |
| 9005.183       | Payment Declined            | Invalid transaction type.                                                                                                                                             |
| 9005.184       | Payment Declined            | Email not valid/not supplied.                                                                                                                                         |
| 9005.185       | Payment Declined            | Phone number not valid/not supplied.                                                                                                                                  |
| 9005.186       | Payment Declined            | Transaction mode differs from original.                                                                                                                               |
| 9005.187       | Payment Declined            | 3DSecure authentication not available for this card.                                                                                                                  |
| 9005.188       | Payment Declined            | 3DSecure authentication rejected.                                                                                                                                     |
| 9005.189       | Payment Declined            | Description not set.                                                                                                                                                  |
| 9005.190       | Payment Declined            | Sold Out.                                                                                                                                                             |
| 9005.191       | Payment Declined            | Card is for ATM use only.                                                                                                                                             |
| 9005.192       | Payment Declined            | Invalid transaction Method.                                                                                                                                           |
| 9005.193       | Payment Declined            | Transaction part not specified.                                                                                                                                       |
| 9005.194       | Payment Declined            | Unable to access transaction part.                                                                                                                                    |
| 9005.195       | Payment Declined            | Error connecting to service provider.                                                                                                                                 |
| 9005.196       | Payment Declined            | Request aborted.                                                                                                                                                      |
| 9005.197       | Payment Declined            | Verification failed.                                                                                                                                                  |
| 9005.198       | Payment Declined            | Refer to card issuer.                                                                                                                                                 |
| 9005.199       | Payment Declined            | Do not honor.                                                                                                                                                         |
| 9005.200       | Payment Declined            | Address verification (AVS) mismatch.                                                                                                                                  |
| 9005.201       | Payment Declined            | Card security code (CVV) and address (AVS) mismatch.                                                                                                                  |
| 9005.202       | Payment Declined            | Card is not enabled for e-commerce.                                                                                                                                   |
| 9005.203       | Payment Declined            | Card cancelled.                                                                                                                                                       |
| 9005.204       | Payment Declined            | No/invalid account.                                                                                                                                                   |
| 9005.205       | Payment Declined            | Invalid Terminal configurations.                                                                                                                                      |
| 9005.206       | Payment Declined            | Invalid value for split parameter.                                                                                                                                    |
| 9005.207       | Payment Declined            | Split payment not enabled for the store.                                                                                                                              |
| 9005.208       | Payment Declined            | Card token validation failed.                                                                                                                                         |
| 9005.209       | Payment Declined            | STCPay order creation falied.                                                                                                                                         |
| 9005.210       | Payment Declined            | Paypal order creation falied.                                                                                                                                         |
| 9005.211       | Payment Declined            | Problem with Cybersource configurations.                                                                                                                              |
| 9005.212       | Payment Declined            | Anti-fraud pre-auth.                                                                                                                                                  |
| 9005.213       | Payment Declined            | Anti-fraud post-auth.                                                                                                                                                 |
| 9005.214       | Payment Declined            | Card limits exceeded.                                                                                                                                                 |
| 9005.215       | Payment Declined            | Terminal limits.                                                                                                                                                      |
| 9005.216       | Payment Declined            | Fraud deteted by the acquirer.                                                                                                                                        |
| 9005.217       | Payment Declined            | Multiple email used with the same card.                                                                                                                               |
| 9005.218       | Payment Declined            | Internal system error.                                                                                                                                                |
| 9005.219       | Payment Declined            | Invalid end date.                                                                                                                                                     |
| 9005.220       | Payment Declined            | Limit value should be less than or equal to 4000.                                                                                                                     |
| 9005.221       | Payment Declined            | The date range exceeds seven days.                                                                                                                                    |
| 9005.222       | Payment Declined            | Invalid or less parameters in URL.                                                                                                                                    |
| 9005.223       | Payment Declined            | From date can not be grater than to date.                                                                                                                             |
| 9005.224       | Payment Declined            | Transaction is already captured.                                                                                                                                      |
| 9005.225       | Payment Declined            | Invalid path parameter.                                                                                                                                               |
| 9005.226       | Payment Declined            | Acquirer system error.                                                                                                                                                |
| 9005.227       | Payment Declined            | Invalid issuer.                                                                                                                                                       |
| 9005.228       | Payment Declined            | Restricted.                                                                                                                                                           |
| 9005.229       | Payment Declined            | Closed card/account.                                                                                                                                                  |
| 9005.230       | Payment Declined            | Authorisation revoked.                                                                                                                                                |
| 9005.231       | Payment Declined            | Fraud suspected by issuer.                                                                                                                                            |
| 9005.232       | Payment Declined            | Fraud suspected by scheme.                                                                                                                                            |
| 9005.233       | Payment Declined            | Scheme lifecycle/policy.                                                                                                                                              |
| 9005.234       | Payment Declined            | Unable to route.                                                                                                                                                      |
| 9005.235       | Payment Declined            | OTP Limit exceeded.                                                                                                                                                   |
| 9005.236       | Payment Declined            | Already paid.                                                                                                                                                         |
| 9005.237       | Payment Declined            | Payment expired.                                                                                                                                                      |
| 9005.238       | Payment Declined            | Coupon expired or invalid – cannot apply to subscription.                                                                                                             |
| 9005.239       | Payment Declined            | Payment mandate invalid or expired – re-auth needed.                                                                                                                  |
| 9005.240       | Payment Declined            | Invoice locked/finalized – cannot modify.                                                                                                                             |
| 9005.241       | Payment Declined            | Payment requires customer authentication (3DS/SCA).                                                                                                                   |
| 9005.242       | Payment Declined            | Authentication required – ask user to complete 3DS or update payment method                                                                                           |
| 9005.243       | Payment Declined            | Payment declined – ask user to try another card or update default payment method                                                                                      |
| 9005.244       | Payment Declined            | Bank account blocked – ask user to add another account or payment method                                                                                              |
| 9005.245       | Payment Declined            | Payment method not available – ask user to select another method                                                                                                      |
| 9005.246       | Payment Declined            | Authentication failed – ask user to retry or update payment method                                                                                                    |
| 9005.247       | Payment Declined            | Payment attempt failed – ask user to retry or change method                                                                                                           |
| 9005.248       | Payment Declined            | Payment expired – ask user to retry or update payment method                                                                                                          |
| 9005.249       | Payment Declined            | Card expired – ask user to update card or provide a new one").                                                                                                        |
| 9005.250       | Payment Declined            | Card declined – ask user to try another card.                                                                                                                         |
| 9005.251       | Payment Declined            | Address mismatch – ask user to correct billing address.                                                                                                               |
| 9005.252       | Payment Declined            | Invalid CVC – ask user to re-enter or use a different card.                                                                                                           |
| 9005.253       | Payment Declined            | Invalid card number – ask user to correct it.                                                                                                                         |
| 9005.254       | Payment Declined            | Postal code mismatch – ask user to correct ZIP.                                                                                                                       |
| 9005.255       | Payment Declined            | Invalid CVC – ask user to correct or use another card.                                                                                                                |
| 9005.256       | Payment Declined            | Invalid expiry month – ask user to update details.                                                                                                                    |
| 9005.257       | Payment Declined            | Invalid expiry year – ask user to update details.                                                                                                                     |
| 9005.258       | Payment Declined            | Invalid field format.                                                                                                                                                 |
| 9005.259       | Payment Declined            | Invalid mandatory field.                                                                                                                                              |
| 9005.260       | Payment Declined            | Unauthorized.                                                                                                                                                         |
| 9005.261       | Payment Declined            | Feature not allowed.                                                                                                                                                  |
| 9005.262       | Payment Declined            | Invalid transaction status.                                                                                                                                           |
| 9005.263       | Payment Declined            | Invalid routing.                                                                                                                                                      |
| 9005.264       | Payment Declined            | Bank not supported.                                                                                                                                                   |
| 9005.265       | Payment Declined            | Invalid Card/Account/Virtual Account/Customer info.                                                                                                                   |
| 9005.266       | Payment Declined            | Bill blocked or not found.                                                                                                                                            |
| 9005.267       | Payment Declined            | Bill expired.                                                                                                                                                         |
| 9005.268       | Payment Declined            | Invalid Product ID.                                                                                                                                                   |
| 9005.269       | Payment Declined            | Invalid Transaction Invoice.                                                                                                                                          |
| 9005.270       | Payment Declined            | Invalid Seller Or Acquiring Bank Code.                                                                                                                                |
| 9005.271       | Payment Declined            | Invalid amount.                                                                                                                                                       |
| 9005.272       | Payment Declined            | Invalid Buyer Account.                                                                                                                                                |
| 9005.273       | Payment Declined            | Invalid Bank                                                                                                                                                          |
| 9005.274       | Payment Declined            | Invalid Seller Exchange Or Seller.                                                                                                                                    |
| 9005.275       | Payment Declined            | Maximum Transaction Limit Exceeded.                                                                                                                                   |
| 9005.276       | Payment Declined            | Invalid Seller for Merchant Specific Limit                                                                                                                            |
| 9005.277       | Payment Declined            | Transaction Not Permitted                                                                                                                                             |
| 9005.278<br /> | Payment Declined            | Transaction To Merchant Not Permitted                                                                                                                                 |
| 9005.279       | Payment Declined            | Invalid Buyer Name Or Buyer ID                                                                                                                                        |
| 9005.280       | Payment Declined            | Blocked Bank                                                                                                                                                          |
| 9005.281       | Payment Declined            | Invalid Transaction setup.                                                                                                                                            |
| 9005.282       | Payment Declined            | Cardholder is not enrolled in 3D Secure                                                                                                                               |
| 9005.283       | Payment Declined            | Transaction retry limit exceeded                                                                                                                                      |
| 9005.284       | Payment Declined            | Authentication is not currently available                                                                                                                             |
|                |                             |                                                                                                                                                                       |
| 9006.1         | Refund Failed               | There was an issue with Refund transaction.                                                                                                                           |
| 9006.2         | Refund Failed               | Invalid Refund Amount                                                                                                                                                 |
| 9006.3         | Refund Failed               | Invalid Refund Parent Order                                                                                                                                           |
| 9006.4         | Refund Failed               | Refund needs to be completed manually by the bank.                                                                                                                    |
| 9006.5         | Refund Failed               | Currently refund cannot be processed, please reach out to client experience.                                                                                          |
|                |                             |                                                                                                                                                                       |
| 9007           | Under Paid                  | Crypto amount received is less than expected order amount.                                                                                                            |
|                |                             |                                                                                                                                                                       |
| 9008.1         | Settlement Failed           | Settlement can't be processed for the given order.                                                                                                                    |
| 9008.2         | Settlement Under Review     | Review details are already submitted                                                                                                                                  |
| 9008.3         | Settlement Failed           | Invalid request id                                                                                                                                                    |
| 9008.4         | Settlement Under Review     | Retry limit reached                                                                                                                                                   |
| 9008.5         | Settlement Under Review     | Processing issue                                                                                                                                                      |
| 9008.6         | Settlement Under Review     | System error                                                                                                                                                          |
| 9008.7         | Settlement Under Review     | Confirmation timeout<br />                                                                                                                                            |

***


[title] Pay3 Webhooks
[path] /

As an order progresses through it's lifecycle, Pay3 shares webhook events with the App's backend about the status of order and other relevant details. This page explains different status and the information related to the webhook. This page also explains how a App can consume the events towards the end of this page.

## API Signature

The application needs to share an API endpoint to which Pay3 service will be sending a webhook as a POST request with a payload which contains webhook data. Below is an example curl of how Pay3 service will be calling the provided webhook endpoint with the data. The API needs to respond back with http status code **200&#x20;**&#x6F;n receiving the data. The server side will retry sending the data 10 times.

```curl
curl --location 'https://your-host-webhookserver.com/sample-webhook-path' \
--header 'Content-Type: application/json' -X POST \
--data '{
    "payload": "eyJhbGciOiJIUzM4NCJ9.eyJvcmRlclR5cGUiOiJGSUFUIiwib3JkZXJJZCI6IjdhZWQwNjRiLWNiMmQtNDJmOC05NTYwLTc3NDEzZGNjNWZjNCIsIm9yZGVyU3RhdHVzIjoiQ09NUExFVEVEIiwib2ZmZXJJZCI6IjMzMGNkNGJiLTE4YTUtNGVkZC1hMWY0LWNkMzczMzU2ZGEwOCJ9.DmIg6ontoWke1hEGVV62gDDNKlT9L3fcRQRWemnLqjf565pH28L3_Nr7_b1C2KTp"
}'
```

## Sample Payload

Below is an example payload which is received in the webhook events provided by Pay3

```javascript
{
 
  "requestId": "ed821e55-7084-467c-9e3f-4279e4d39c97"
  "data": {
   "orderType": "CHECKOUT",
   "orderId": "9c4dd5b3-64de-4d94-b696-3e92cd6b12ba",
   "orderStatus": "COMPLETED"
   "walletAddress": "0x..." 
  },
  "type": "pay3-sdk-transaction-status"
}
```

### Payload Schema

1. `data` : Following keys are present in this object.
   1. `orderType`: Indicates the type of order for which the event is sent for. If the given order contains a crypto transaction as well as fiat transaction, two events of different order types will be sent for the same orderId.
      1. CHECKOUT - Payment done by user using Fiat currency
      2. PAYOUT - Withdraw Fiat request done by user
      3. CRYPTO - Payment done by user using Crypto currency&#x20;
   2. `orderId`: It provides a unique identification of the order which is managed by Pay3.
   3. `orderStatus`: It indicates the various status in which an order can be. Details about different kind of statuses can be find below ([Order Status](docId\:kw6rKJoQsYoUftKUvgyhq)).&#x20;
   4. `paymentStatus`: It indicates the payment status of the order. Details about different kind of payment statuses can be find below ([Payment Status](docId\:kw6rKJoQsYoUftKUvgyhq))&#x20;
   5. `walletAddress`: It shows the wallet address assigned to the order.&#x20;
2. `error` (Type Object, Optional): Following keys will be present if there is an error. Please refer to [SDK Errors](docId\:upvtC67WkwGNCSCjVAQ0v) for reference
   1. &#x20;`code` (Type number): Error code.
   2. `message` (Type string):  Error message.&#x20;
3. `requestId` : Request Id that was passed by App while initialising the modal.
4. `type` : Type of the event.&#x20;
   1\. For all Order status / Payment Status changes, the type will be  **pay3-sdk-transaction-status**.&#x20;

Refer [Status Reference](docId\:kw6rKJoQsYoUftKUvgyhq) for all order and payment status details.

## Usage of Webhooks functionality

The payload of webhooks is in the form of Json Web Tokens (JWT). These tokens can be decoded using a secret to retrieve the status for a given order. This secret will be shared by Pay3 team.

Sample code to decode data :&#x20;

```javascript
const jwt = require('jsonwebtoken');

let inputData = 'eyJhbGciOiJIUzM4NCJ9.eyJvcmRlclR5cGUiOiJGSUFUIiwib3JkZXJJZCI6IjdhZWQwNjRiLWNiMmQtNDJmOC05NTYwLTc3NDEzZGNjNWZjNCIsIm9yZGVyU3RhdHVzIjoiQ09NUExFVEVEIiwib2ZmZXJJZCI6IjMzMGNkNGJiLTE4YTUtNGVkZC1hMWY0LWNkMzczMzU2ZGEwOCJ9.DmIg6ontoWke1hEGVV62gDDNKlT9L3fcRQRWemnLqjf565pH28L3_Nr7_b1C2KTp';

let secret = 'YOUR_CLIENT_SECRET';

let decodedData = jwt.verify(data, secret);

```

Some of our downstream partners don't provide with all the statuses , in those cases some events might be skipped. But COMPLETED / FAILED will always be the terminal events.

***


[title] Create Fiat Checkout Order
[path] Pay3 API Documentation/

This API creates a payin order to enable users to make checkout transactions. It accepts amount and currency details. On creating an order a dynamic `token` is returned from this api which is required to be passed to Pay3 SDK

This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Create Checkout Order",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/checkout/create-order",
  "description": "Create an order with payin details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "nyfSHp7J-NrsuqTH3FW7t",
        "language": "curl",
        "code": "curl --location 'https://api.prod.pay3.app/v1/client/checkout/create-order' \\\n--header 'signature: {{signature}}' \\\n--header 'access-token: eyJraWQiOiIxYmI5NjA1YzM2ZVRCWkJMOHllMDRmcjBkcEo2OTM4NjgzMDIwMmIyZCIsInR5cCI6IkpXVCIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiIxY2VjOGM3YS1kNjMzLTQzMDUtYmJkZi00N2M3ZWJlYWU1YmEiLCJpc3MiOiJodHRwczovL3M4ZXFtbWE5ZDguZXhlY3V0ZS1hcGkudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vcHJvZC92MS91c2VyLW1hbmFnZW1lbnQvLndlbGwta25vd24vandrcy5qc29uIiwiaWF0IjoxNzU2NDU2MTgxLCJleHAiOjE3NTY0NTc5ODF9.mzRmTnht4TsGUQpV5P_QfNdlODyq12ootG_hmb5NelsfpOjIiPMk2xz9rrIqtvQG3uVxvZXdRl5VjKsi9HbIkcaj543fUBjTEsumFnYGaVbbRXCVki_TUanWYZPi4GCJs7JD7VA35AfWbiEC0spYGn9quxhyiEHu9n5u0_05kf11GeDa99HNCHGSxKxYY0aOFGWcdoietZIGHIZjQqERzMnmR8ehuSzzt7_ulD2Vrpj8oowRvDbHLboKICKalNQUzgROTWUQRPFmRRb5yREpiCFfjEyuJzjtEwuNqh5M2oEGZwuTBzaXOSdZda7uhMp7hFh5lm5WhVMz6HR_k8GNdw' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"currencyId\": \"usd_usa\",\n    \"fiatAmount\": \"10.00\",\n    \"paymentMethodId\": \"all\",\n    \"email\": \"user@email.com\",\n    \"clientId\": \"4894a422-1209-4371-9961-7e60008ec3e1\",\n    \"requestId\": \"889938983\",\n    \"mode\": \"returnUrl\",\n    \"callbackUrl\": \"https://www.google.com\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "nyfSHp7J-NrsuqTH3FW7t"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "{\n    \"requestId\": \"9824649238\",\n    \"token\": \"a35dc551-9fb4-491c-9f9b-44d9c2ef4b32\",\n    \"status\": \"CREATED\",\n    \"offerInfoData\": {\n        \"userAddress\": \"user@email.com\",\n        \"clientId\": \"your-client-id\",\n        \"selectedPaymentMethod\": \"your-paymentMethodId\",\n        \"totalFiatAmount\": \"10.00\",\n        \"expiryTs\": \"2025-04-21T16:12:09.287975+00:00\",\n        \"currencyId\": \"your-currency-id\",\n        \"type\": \"BUY\"\n    }\n}",
        "customLabel": ""
      },
      {
        "id": "tIvoQbUSKGnrqallvNDVQ",
        "language": "401",
        "code": "{\n    error: {\n      code: '7001',\n      message: 'Order already exists for given requestId'\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "signature",
        "kind": "required",
        "type": "string",
        "description": "Signature generated with sha256 followed by base64 encoding. Check below section for more details",
        "children": []
      },
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "currencyId",
        "kind": "required",
        "type": "string",
        "description": "This will be provided by Pay3 during onboarding",
        "": "This will be provided by Pay3 during onboarding"
      },
      {
        "name": "fiatAmount",
        "kind": "required",
        "type": "string",
        "description": "Amount user have to Pay in string format. Maximum two decimal places are allowed",
        "": "Amount user have to Pay in string format. Maximum two decimal places are allowed"
      },
      {
        "name": "email",
        "kind": "required",
        "type": "string",
        "description": "User email to identify the user, which will be available in reporting dashboard",
        "": "required"
      },
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by client application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. It is required to be globally unique example UUID.",
        "": "Identifier that is created by client application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. It is required to be globally unique example UUID."
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "paymentMethodId",
        "kind": "optional",
        "type": "string",
        "description": "Unique string identifier. This will be provided by Pay3 during onboarding ",
        "": "optional"
      },
      {
        "name": "userId",
        "kind": "optional",
        "type": "string",
        "description": "It is a type of UUID. It will used as unique identifier of the user. If this is not passed, email will be used as a unique identifier of the user within Pay3.",
        "": "It is a type of UUID. It will used as unique identifier of the user. If this is not passed, email will be used as a unique identifier of the user within Pay3."
      },
      {
        "name": "userMessage",
        "kind": "optional",
        "type": "string",
        "description": "Short meaningful name of the asset user is about to purchase. ",
        "": "Short meaningful name of the asset user is about to purchase. "
      },
      {
        "name": "firstName",
        "kind": "optional",
        "type": "string",
        "description": "First name of the user with maximum length of 50 characters.",
        "": "First name of the user with maximum length of 50 characters."
      },
      {
        "name": "lastName",
        "kind": "optional",
        "type": "string",
        "description": "Last name of the user with maximum length of 50 characters.",
        "": "Last name of the user with maximum length of 50 characters."
      },
      {
        "name": "phoneNumber",
        "kind": "optional",
        "type": "string",
        "description": "This is the phone number of the user in E.164 format [+][country code][number including area code] which can have a maximum of fifteen digits.",
        "": "This is the phone number of the user in E.164 format [+][country code][number including area code] which can have a maximum of fifteen digits."
      },
      {
        "name": "mode",
        "kind": "optional",
        "type": "string",
        "description": "returnUrl - In this mode, the API returns a Pay3 payment URL that can be embedded directly into the client’s application. This is useful when the client wants to open the Pay3 URL inside a WKWebView (iOS), WebView (Android/React Native), or an <iframe> in a web app.\n\nreturnAppUrl - In this mode, the api will return supported Android / iOS application url. This requires valid targetApp parameter in the body.",
        "": "returnUrl - In this mode, the API returns a Pay3 payment URL that can be embedded directly into the client’s application. This is useful when the client wants to open the Pay3 URL inside a WKWebView (iOS), WebView (Android/React Native), or an <iframe> in a web app.\n\nreturnAppUrl - In this mode, the api will return supported Android / iOS application url. This requires valid targetApp parameter in the body."
      },
      {
        "name": "targetApp",
        "kind": "optional",
        "type": "string",
        "description": "This is required when the user chooses a perticular iOS/Android application to complete the payment.",
        "": "This is required when the user chooses a perticular iOS/Android application to complete the payment."
      },
      {
        "name": "deviceContext",
        "kind": "optional",
        "type": "object",
        "description": "Information about the mobile environment",
        "": "Information about the mobile environment",
        "children": [
          {
            "name": "deviceOS",
            "kind": "optional",
            "type": "string",
            "description": "ANDROID or IOS"
          }
        ],
        "schema": [
          {
            "name": "deviceOS",
            "kind": "optional",
            "type": "string",
            "description": "ANDROID or IOS"
          }
        ]
      },
      {
        "name": "pixKey",
        "kind": "optional",
        "type": "string",
        "description": "This is the unique identifier for a user in the PIX system, provided by the user. It can be an email address, phone number, CPF, or a random key.",
        "": "This is the unique identifier for a user in the PIX system, provided by the user. It can be an email address, phone number, CPF, or a random key."
      },
      {
        "name": "intlBankAccount",
        "kind": "optional",
        "type": "string",
        "description": "This is the International Bank Account Number (IBAN) entered by the user. It follows the standard IBAN format, which includes the country code, check digits, and the bank account number.",
        "": "This is the International Bank Account Number (IBAN) entered by the user. It follows the standard IBAN format, which includes the country code, check digits, and the bank account number."
      },
      {
        "name": "bankAccount",
        "kind": "optional",
        "type": "string",
        "description": "This is the bank account number entered by the user. It is specific to the user's bank and is used to identify the user's account within the financial institution.",
        "": "This is the bank account number entered by the user. It is specific to the user's bank and is used to identify the user's account within the financial institution."
      },
      {
        "name": "docType",
        "kind": "optional",
        "type": "string",
        "description": "This specifies the type of document, which for instance for Brazil is CPF (Cadastro de Pessoas Físicas). CPF is the Brazilian individual taxpayer registry identification.",
        "": "This specifies the type of document, which for instance for Brazil is CPF (Cadastro de Pessoas Físicas). CPF is the Brazilian individual taxpayer registry identification."
      },
      {
        "name": "docId",
        "kind": "optional",
        "type": "string",
        "description": "This is the Documentation ID, entered by the user. It corresponds to the specific identifier for the type of document (e.g., CPF number) provided.",
        "": "This is the Documentation ID, entered by the user. It corresponds to the specific identifier for the type of document (e.g., CPF number) provided."
      },
      {
        "name": "callbackUrl",
        "kind": "optional",
        "type": "string",
        "description": "Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter data query parameter will be added to the url. ",
        "": "Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter data query parameter will be added to the url. "
      },
      {
        "name": "lang",
        "kind": "optional",
        "type": "string",
        "description": "This parameter specifies the language preference for the Pay3 SDK. The strings used follow two letter language code as in ISO 639-1. Example pt for Portuguese, en for English.",
        "": "This parameter specifies the language preference for the Pay3 SDK. The strings used follow two letter language code as in ISO 639-1. Example pt for Portuguese, en for English."
      },
      {
        "name": "  requestDescription",
        "kind": "optional",
        "type": "string",
        "description": "This parameter accepts a string value and is used to provide a short description of the purpose of the transaction, such as \"Shoes Purchase\", \"Bill Payment\", etc.\n\nAlthough this is an optional parameter, it may be mandatory for certain geographies or currencies based on regulatory or compliance requirements. If applicable, the Pay3 team will inform you during the integration process.",
        "": "string"
      },
      {
        "name": "billingData",
        "kind": "optional",
        "type": "object",
        "description": "This parameter is an object that accepts these fields :- \n\"address\", \"street\" , \"city\" , \"state\" , \"country\" (In two letter format) , and \"postalCode\". \n\nAlthough this is an optional parameter, it may be mandatory for certain geographies or currencies based on regulatory or compliance requirements. If applicable, the Pay3 team will inform you during the integration process.",
        "": "object",
        "children": [
          {
            "name": "address",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "street",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "city",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "state",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "country",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "postalCode",
            "kind": "optional",
            "type": "string",
            "description": ""
          }
        ],
        "schema": [
          {
            "name": "address",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "street",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "city",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "state",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "country",
            "kind": "optional",
            "type": "string",
            "description": ""
          },
          {
            "name": "postalCode",
            "kind": "optional",
            "type": "string",
            "description": ""
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "create-checkout-order",
  "legacyHash": "706EUjTSNEFgKfL4kKq4S"
}
```
:::

##

## Signature Generation

The request for creating checkout order requires a header `signature`. This can be generated using following code snippet.&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const fiatAmount =  "0.02";
const requestId = "Order-Id-Generated-By-Application";
const clientId = "your-client-id";
const accessToken = "dynamic-access-token";

const getSignature = (secretKey, fiatAmount, requestId) => {
    // Prepare the string to sign in same format. 
    // fiatAmount followed by requestId
    const stringToSign = 'fiatAmount=' + fiatAmount + '&requestId=' + requestId;
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, fiatAmount, requestId);
```

***


[title] Get Crypto Order Details
[path] Pay3 API Documentation/

API that returns clients crypto orders matching the *requestId*. This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

The response is a list of Crypto Orders which matches the given criteria.

1. `orderId`
2. `orderStatus` : For list of possible status please refer : [Order Status](docId\:kw6rKJoQsYoUftKUvgyhq)&#x20;
3. `updatedTs` : Last Order updated timestamp in epoch milliseconds
4. `orderType` : Type of Order. Can be CHECKOUT/PAYOUT
5. `requestId` : Unique ID passed during Order creation
6. `clientId` : Client ID
7. `paymentStatus` : For list of possible payment status please refer: [Payment Status](docId\:kw6rKJoQsYoUftKUvgyhq)&#x20;
8. `receivedAmount` : Actual amount received in supported currency
9. `payersEmail` : Email of the user
10. `settlementStatus`:  Status of the settlement
11. `txnHash`: On-Chain transaction hash&#x20;
12. `cryptoCurId` : Name of the currency supported
13. `cryptoAmount` : Currency Amount
14. `errorReason` : Contains `errorCode` and `errorDesc`. Will be received only in case if status is FAILED. List of possible [Error Codes](docId\:upvtC67WkwGNCSCjVAQ0v)

:::ApiMethodV2
```json
{
  "name": "Get Order Details",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v1/client/crypto-orders?requestId=your-request-id&clientId=your-client-id",
  "description": "Get order details by client's request-id",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "3LjxGJCqZzKeICMDOi23s",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/crypto-orders?requestId=your-request-id&clientId=your-client-id' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'access-token: ACCESS-TOKEN-IN-JWT'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "3LjxGJCqZzKeICMDOi23s"
  },
  "results": {
    "languages": [
      {
        "id": "GC_lbEEV7Jo_hgFNI1cHK",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"data\": [\n        {\n            \"orderId\": \"5616750d-4829-4099-aacb-16deadf36cde\",\n            \"orderStatus\": \"COMPLETED\",\n            \"updatedTs\": 1725261631603,\n            \"orderType\": \"CryptoPayin\",\n            \"requestId\": \"nlnwevw_5e449b97\",\n            \"clientId\": \"5e449b97-c53b-4ed0-ac00-7b50e2f2406b\",\n            \"paymentStatus\": \"COMPLETED\",\n            \"receivedAmount\": \"0.00018900\",\n            \"payersEmail\": \"satoshi@email.com\",\n            \"settlementStatus\": \"NOT_REQUIRED\",\n            \"txnHash\": \"08930348ce4d928694889a\",\n            \"cryptoCurId\": \"btc_bitcoin\",\n            \"cryptoAmount\": \"0.000173\",\n            \"errorReason\": {\n                \"errorCode\": \"9004\",\n                \"errorDesc\": \"Error occurred while the payment was processed by the payment partner\"\n            }\n        }\n    ]\n}"
      },
      {
        "id": "Ybev9LI4TwGz-n2zW-919",
        "language": "401",
        "customLabel": "",
        "code": "{\"error\":\"Client verification failed\"}"
      }
    ],
    "selectedLanguageId": "GC_lbEEV7Jo_hgFNI1cHK"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Request Id is the unique id that was passed by your application while creating the order.",
        "children": []
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client Id",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-order-details",
  "legacyHash": "S47PRCosdcg6c9bw46JEG"
}
```
:::

***


[title] Generate Payment Links
[path] /

To generate payment links through Pay3 Dashboard and share it with the end user, follow these simple steps:

Pre-requisite: Log in to your Pay3 dashboard.

Step 1: Navigate to the "Generate Payment Link" section on the Pay3 Dashboard

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/QtVUGrbg9qfbxaEoXT7nH_screenshot-2025-03-29-at-101846-pm.png" size="50" width="968" height="1120" position="center" darkWidth="968" darkHeight="1120" showCaption="false"}

Step 2: Click on "Generate New Link".

![](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/5yuV0Ma2iRZtSI9iKIOkM_screenshot-2025-03-29-at-102020-pm.png)

Step 3:&#x20;

Enter the following details:
1\. Invoice Number: Your unique order ID.

2\. Currency: Select currency from the dropdown.

3\. Payers email: Email of the person who will be paying through this link

4\. Amount: Specify currency (minimum of $1.00 in case of USD)

5\. Destination Address: Your wallet address for receiving Crypto/Stablecoins. This is obtained from the merchant at the time of onboarding and pre-filled to avoid accidental errors, etc.

6\. Click "Create Order".

![](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/WR7Wf8_5cMGrD72pmBJRR_screenshot-2025-03-29-at-102153-pm.png)

Step 4: Confirm the details, and you will be taken to the next screen, where the entered amount, selected currency, and equivalent amount in stablecoins will be shown.&#x20;

If the link is being generated for other cryptocurrencies, the equivalent crypto amount will be displayed and the amount is locked for 24 hours. You can copy the link from this step, as shown below, or alternatively, from the dashboard anytime after the creation.

The generated link is valid for 24 hours.

![](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/OydLvUERmzZM0BUUULusp_screenshot-2025-03-29-at-102241-pm.png)

![](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/c5-X_pH07PAvmvjgYJ398_screenshot-2025-03-29-at-102241-pm.png)

***


[title] Initialize
[path] Pay3 React Native SDK/

## React App Dependencies&#x20;

The Pay3 react native sdk `@pay3/sdk-react-native` needs additional libraries to be added to app's package.json namely `@react-native-async-storage/async-storage` and `react-native-webview`. These provide native support in Android and iOS devices.

```javascript
  "dependencies": {
    "@pay3/sdk-react-native": "^1.0.6",
    "@react-native-async-storage/async-storage": "^1.21.0",
    "react-native-webview": "^13.6.4"
  }
```

## initPay3()

This function initialises Pay3 SDK to support Fiat Checkout flow.

*Pay3 team* shares values for `hostname`, `clientId` and `firebaseConfigs` during onboarding. Following parameters can be used for creating new instance of Pay3.&#x20;

**Parameters**

1. **hostname**: Pay3 will be opened in a new window using this hostname prefix. The host name is environment dependent.&#x20;
2. **clientId**: A unique client id is created for each client application. The client id is environment dependent.
3. **isPaymentMode** : Pass `true` for fiat checkout in payments only mode.&#x20;
4. **firebaseConfigs**: JSON config for firebase realtime database. This is used to publish realtime events to the app.
5. **appDeepLink**:  This string in the form of `scheme://resource` can be passed during initalization. This will be used by Pay3 as referrer / redirect intent. The string needs to be whitelisted in Pay3 backend for proper working of the Pay3 services.&#x20;

:::CodeblockTabs
index.js

```javascript
import { initPay3 } from '@pay3/sdk-react-native';
const pay = await initPay3({
  clientId,
  hostname,
  firebaseConfigs, 
  isPaymentMode: true,
  appDeepLink,
});
```
:::

***


[title] Get Fiat Order List
[path] Pay3 API Documentation/

This api returns list of orders matching the query parameters. This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Get Order List",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v2/client/fiat-orders?userAddress=email@address.com&gte=2024-07-15&lte=2024-07-15",
  "description": "Get order details by query parameters",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "3LjxGJCqZzKeICMDOi23s",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v2/client/fiat-orders?userAddress=email%40address.com&gte=2024-07-15&lte=2024-07-15' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'access-token: ACCESS-TOKEN-IN-JWT'\\\n--header 'client-id: your-client-id' \\",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "3LjxGJCqZzKeICMDOi23s"
  },
  "results": {
    "languages": [
      {
        "id": "GC_lbEEV7Jo_hgFNI1cHK",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"message\": \"Records Found, successful\",\n    \"FiatTransactions\": [\n        {\n            \"orderStatus\": \"COMPLETED\",\n            \"requestId\": \"00837830-5854-47c4-9361-3921abc6e831\",\n            \"clientId\": \"your-client-id\",\n            \"exchangeCurId\": \"brl_bz\",\n            \"exchangeAmount\": \"2.02\",\n            \"updatedTs\": 1721020103515,\n            \"createdTs\": 1721020103515,\n            \"orderId\": \"5d6a9682-1938-4a6f-a252-61378f67dac9\",\n            \"userAddress\": \"email@address.com\",\n            \"orderType\": \"PAYOUT\",\n            \"paymentStatus\": \"COMPLETED\",\n            \"paymentInstrument\": \"pix\"\n        },\n        {\n            \"orderStatus\": \"FAILED\",\n            \"requestId\": \"40204\",\n            \"clientId\": \"your-client-id\",\n            \"exchangeCurId\": \"brl_bz\",\n            \"exchangeAmount\": \"2.00\",\n            \"updatedTs\": 1721223117912,\n            \"createdTs\": 1721222981384,\n            \"orderId\": \"795581c9-a0ce-4473-a001-cc89aff33f50\",\n            \"userAddress\": \"email@address.com\",\n            \"orderType\": \"CHECKOUT\",\n            \"paymentStatus\": \"CANCELLED\",\n            \"paymentInstrument\": \"credit_card\"\n        }\n    ]\n}"
      },
      {
        "id": "Ybev9LI4TwGz-n2zW-919",
        "language": "401",
        "customLabel": "",
        "code": "{\"error\":\"Client verification failed\"}"
      }
    ],
    "selectedLanguageId": "GC_lbEEV7Jo_hgFNI1cHK"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "userAddress",
        "kind": "required",
        "type": "string",
        "description": "Email address/userId used while creating the transaction.",
        "": "Email address/userId used while creating the transaction."
      },
      {
        "name": "gte",
        "kind": "required",
        "type": "string",
        "description": "Transaction created on or after this date. Date in YYYY-MM-DD format.",
        "children": []
      },
      {
        "name": "lte",
        "kind": "required",
        "type": "string",
        "description": "Transaction created on or before this date. Date in YYYY-MM-DD format.",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      },
      {
        "name": "client-id",
        "kind": "required",
        "type": "string",
        "description": "Client Id",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-order-list",
  "legacyHash": "C2PnDXYVF4_laTuhnOe-R"
}
```
:::

***


[title] Create Subscription Order
[path] Pay3 API Documentation/

This API creates a subscription order to enable users to make payment and start subscriptions. It accepts amount and currency details. On creating an order a dynamic `token` is returned from this api which is required to be passed to Pay3 SDK

This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Create Checkout Order",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/checkout/create-order",
  "description": "Create an order with payin details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "nyfSHp7J-NrsuqTH3FW7t",
        "language": "curl",
        "code": "curl --location 'https://api.dev.pay3.app/v1/client/subscription/create-order' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'signature: {{signature}}' \\\n--header 'access-token: ' \\\n--data-raw '{\n    \"currencyId\": \"usd_usa\",\n    \"fiatAmount\": \"1.00\",\n    \"paymentMethodId\": \"all\",\n    \"email\": \"user@example.com\",\n    \"userId\": \"....\",\n    \"clientId\": \"....\",\n    \"requestId\": \"....\",\n    \"interval\": \"MONTHLY\",\n    \"requestDescription\": \"Gold plan\",\n    \"mode\": \"returnUrl\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "nyfSHp7J-NrsuqTH3FW7t"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "{\n    \"requestId\": \"5a3566b0-b0a9-4329-b48f-2921c715ce44\",\n    \"url\": \"https://dev-ui.pay3.app/web-sdk-pay/3b789bdc-3b33-4123-be35-459f58787cee?referrer=https://dev-ui.pay3.app&action=subscription&data=eyJyZXF1ZXN0SWQiOiI1YTM1NjZiMC1iMGE5LTQzMjktYjQ4Zi0yOTIxYzcxNWNlNDQiLCJ0b2tlbiI6IjBhZDM3OTQxLTg2ODItNDg5NC1iMDlkLWYzYjg3MzhkOTY5ZSJ9&lang=en\",\n    \"token\": \"0ad37941-8682-4894-b09d-f3b8738d969e\",\n    \"status\": null\n}",
        "customLabel": ""
      },
      {
        "id": "tIvoQbUSKGnrqallvNDVQ",
        "language": "401",
        "code": "{\n    \"code\": \"7001\",\n    \"error\": {\n        \"code\": \"500\",\n        \"message\": \"No route found for subscription\"\n    }\n}\n\n{\n    \"code\": \"7001\",\n    \"error\": {\n        \"code\": \"500\",\n        \"message\": \"Invalid value for interval: DAILY1\"\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "signature",
        "kind": "required",
        "type": "string",
        "description": "Signature generated with sha256 followed by base64 encoding. Check below section for more details",
        "children": []
      },
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "currencyId",
        "kind": "required",
        "type": "string",
        "description": "This will be provided by Pay3 during onboarding",
        "": "This will be provided by Pay3 during onboarding"
      },
      {
        "name": "fiatAmount",
        "kind": "required",
        "type": "string",
        "description": "Amount user have to Pay in string format. Maximum two decimal places are allowed",
        "": "Amount user have to Pay in string format. Maximum two decimal places are allowed"
      },
      {
        "name": "paymentMethodId",
        "kind": "required",
        "type": "string",
        "description": "Unique string identifier. This will be provided by Pay3 during onboarding ",
        "": "required"
      },
      {
        "name": "email",
        "kind": "required",
        "type": "string",
        "description": "User email to identify the user, which will be available in reporting dashboard",
        "": "required"
      },
      {
        "name": "userId",
        "kind": "required",
        "type": "string",
        "description": "It is a type of UUID. It will used as unique identifier of the user. If this is not passed, email will be used as a unique identifier of the user within Pay3.",
        "": "required"
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by client application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. It is required to be globally unique example UUID.",
        "": "Identifier that is created by client application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. It is required to be globally unique example UUID."
      },
      {
        "name": "interval",
        "kind": "required",
        "type": "string",
        "description": "Defines the billing frequency for the subscription. This value determines how often the recurring payment will be charged after the initial payment.\n\nAllowed values: DAILY, WEEKLY, MONTHLY, YEARLY\n\nThe interval must match the subscription plan configured on Pay3. Any mismatch will result in request validation failure.",
        "": "required"
      },
      {
        "name": "requestDescription",
        "kind": "required",
        "type": "string",
        "description": "The subscription plan name as displayed on the client’s UI. This value is used by Pay3 to identify and match the subscription plan associated with the request.\n\nThe requestDescription must exactly match the plan name configured on the client side to ensure correct subscription mapping and recurring billing setup.",
        "": "required"
      },
      {
        "name": "mode",
        "kind": "required",
        "type": "string",
        "description": "returnUrl - In this mode, the API returns a Pay3 payment URL that can be embedded directly into the client’s application. This is useful when the client wants to open the Pay3 URL inside a WKWebView (iOS), WebView (Android/React Native), or an <iframe> in a web app.\n",
        "": "required"
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "create-checkout-order",
  "legacyHash": "706EUjTSNEFgKfL4kKq4S"
}
```
:::

## Signature Generation

The request for creating checkout order requires a header `signature`. This can be generated using following code snippet.&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const fiatAmount =  "0.02";
const requestId = "Order-Id-Generated-By-Application";
const currencyId = "currency-id";
const interval = "MONTHLY";
const trialPeriodDays = "7";
const clientId = "your-client-id";
const accessToken = "dynamic-access-token";

const getSignature = (secretKey, fiatAmount, requestId) => {
    // Prepare the string to sign in same format. 
    // currencyId, fiatAmount, requestId and interval (if trialPeriodDays then add trialPeriodDays as well)
    let stringToSign = 'currencyId=' + currencyId + 
                        '&fiatAmount=' + fiatAmount + 
                        '&requestId=' + requestId +
                        '&interval=' + interval;
    if(trialPeriodDays && trialPeriodDays != "") {
        stringToSign = stringToSign + '&trialPeriodDays=' + trialPeriodDays;
    }
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, fiatAmount, requestId);
```

***


[title] Initialize
[path] Pay3 Android SDK/

## Installation

&#x20;Add the Pay3 SDK to your app's `build.gradle`

:::CodeblockTabs
build.gradle.kts

```none
dependencies {
    implementation("money.pay3:android-sdk:1.0.0")
}
```
:::

## Initialize the SDK

Initialize the Pay3 SDK in your application's main activity:

This function initialises Pay3 SDK to support Fiat Checkout flow.

*Pay3 team* shares values for `hostname` and `clientId`  during onboarding. Following parameters can be used for creating new instance of Pay3.&#x20;

**Parameters**

1. **hostname**: Pay3 will be opened in a new window using this hostname prefix. The host name is environment dependent.&#x20;
2. **clientId**: A unique client id is created for each client application. The client id is environment dependent.

:::CodeblockTabs
MainActivity.kt

```kotlin
import com.pay3.sdk.Pay3

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        // Initialize SDK with your client ID and hostname
        Pay3.init(this, "your-client-id", "https://pay3-hostname-shared-by-pay3") 
        
        // Rest of your activity code
    }
}
```
:::

***




#


[title] Fiat Checkout Quick Start
[path] Getting Started/

This document provides a quick overview of how to create a fiat checkout order and receive payments from users.

## Fia&#x74;**&#x20;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.&#x20;

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:&#x20;**&#x47;et Access Token&#x20;

To generate the Access Token, you will call the API with the api-secret and client-id.
Please refer to the [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA).&#x20;

### **Step 2:&#x20;**&#x43;reate 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](docId\:twxeK26s1FEfj4VBXDnO7) .

### **Step 3:** Call [Create Fiat Checkout Order](docId\:twxeK26s1FEfj4VBXDnO7)  API.

Sample Payload

```javascript
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": "user@email.com",  //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

```javascript
{
    "requestId": "9824649238",
    "token": "a35dc551-9fb4-491c-9f9b-44d9c2ef4b32",
    "status": "CREATED",
    "offerInfoData": {
        "userAddress": "user@email.com",
        "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:&#x20;**&#x52;edirect User to Checkout Page

Once the user clicks on Checkout, redirect the user to the "**url**" in the response above.

### **Step 5:&#x20;**&#x55;ser Makes the  Payment

The user enters card details and complete the payment.&#x20;

### **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](https://yoursite.com/successpage)".

### Step 8: Listen for Webhook Events&#x20;

Pay3 backend sends webhook notifications with status updates.
Upon receiving an event, you may call the [Get Fiat Order Details](docId\:EvzG5iQKqdzSR1_pKKNDs)  to retrieve the latest order details.

***


[title] Status Reference
[path] /

This document lists all possible order status and its sub payment status.&#x20;

## Order Status

Below is the list of status which are shared in webhook for orders related to **fiat and crypto checkout and payout transactions.**

| Order Status               | Order Status Description                                                                                                                                     |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CREATED                    | Order initiated                                                                                                                                              |
| ORDER\_STARTED             | Payment partner has started the order&#xA;                                                                                                                   |
| ORDER\_PAYMENT\_AWAITING   | Payment partner is waiting for user to complete the Payment                                                                                                  |
| ORDER\_PAYMENT\_PROCESSING | Payment partner checking for payment record. &#xA;User will be shown processing screen                                                                       |
| ORDER\_PAYMENT\_INITIATED  | Payment partner is checking for payment record and will make the payment. &#xA;User can close the Pay3 payment screen                                        |
| COMPLETED                  | Payment is successfully completed. <br />Refer to the `exchangeAmount / receivedAmount` field in the "Fiat/Crypto Order Details API" to verify the paid sum. |
| FAILED                     | Error occurred during the process                                                                                                                            |
| ABANDONED                  | Transaction timeout                                                                                                                                          |

## Payment Status

Some of the Order Status can have payment status&#x20;

| Payment Status                | Parent Order Status       | Payment Status Description                                                                                                                              |
| ----------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SUCCESS/COMPLETED             | COMPLETED                 | Payment completed successfully                                                                                                                          |
| DECLINED                      | FAILED                    | Declined by Payment Partner                                                                                                                             |
| CANCELED                      | FAILED                    | User cancelled the transaction                                                                                                                          |
| MAX\_RETRIES\_REACHED         | ABANDONED                 | Transaction timeout                                                                                                                                     |
| UNDER\_PAID\_FAILED           | FAILED                    | **Crypto amount** received is less than expected order amount                                                                                           |
| UNDER\_PAID                   | COMPLETED                 | **Crypto amount** received is within the minimun configured under payment limit.                                                                        |
| OVER\_PAID                    | COMPLETED                 | **Crypto amount&#x20;**&#x72;eceived is more than order amount                                                                                          |
| AWAITING\_APPROVAL            | ORDER\_PAYMENT\_INITIATED | The transaction is currently under review.                                                                                                              |
| REFUNDED                      | FAILED                    | Refund has been completed.                                                                                                                              |
| REFUND\_INITIATED             | FAILED                    | Refund has been initiated by Pay3                                                                                                                       |
| REFUND\_FAILED                | FAILED                    | There was in issue with Refund transaction                                                                                                              |
| REVIEW\_CREATED               | COMPLETED                 | In cases where the payment partner requires additional documents before settlement, the payment status changes from COMPLETED to  REVIEW\_CREATED       |
| REVIEW\_SUBMITTED             | COMPLETED                 | Status after the details are submitted to Payment partner for review                                                                                    |
| REVIEW\_INPROGRESS            | COMPLETED                 | Status when the payment partner starts reviewing the documents submitted                                                                                |
| REVIEW\_COMPLETED             | COMPLETED                 | Status on completion of review, this will be followed by REVIEW\_SETTLED                                                                                |
| REVIEW\_FAILED                | COMPLETED                 | Expiry of the Review request                                                                                                                            |
| REVIEW\_SETTLED               | COMPLETED                 | Status once the funds are transfered from Payment partner to App's account, in the cases where Review & Settlement flow is needed.                      |
| REVIEW\_MAX\_RETRIES\_REACHED | COMPLETED                 | Review did not reach a terminal status within configured time frame. Terminal states are REVIEW\_SETTLED, REVIEW\_FAILED, REVIEW\_MAX\_RETRIES\_REACHED |

***


[title] Fiat Payout Server-Side API
[path] Getting Started/

This document explains how to create a fiat payout order and process user withdrawals using a backend-only, server-to-server API without any user interface.

The [Create Fiat Payout Order](docId\:cz-cuTNjfgEFE_EokAwiO)**&#x20;&#x20;**&#x41;PI creates a payout order and returns the parameters required to process the withdrawal.  When **mode=**`createVerify` is passed, no website URL or UI is generated. Instead, the API response will share the required details by our downstream partner like `fullName`, `accountNumber`, `bankName`, `upiId`, `pixKey`, `message`.&#x20;

Once you receive these parameters, your backend can call the [Execute Fiat Payout Order](docId\:A3yTB3ovV03fgjWUX7XOz)  API to complete the withdrawal. This final API asyncronously submits the transaction to our downstream partner and share a status.&#x20;

Pay3 backend sends events to your backend service with real-time updates on the payout status. When you receive an event, you may call the [Get Fiat Order Details](docId\:EvzG5iQKqdzSR1_pKKNDs) API to fetch the latest payout information.&#x20;
**Note**: Refer to the `exchangeAmount` field to verify the paid sum.

## **Steps**

### **Step 1:&#x20;**&#x47;et Access Token&#x20;

To generate the Access Token, you will call the API with the api-secret and client-id. Please refer to the [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA).&#x20;

### **Step 2:&#x20;**&#x43;reate a Signature with Parameters

The payout request requires a signature in the header. This can be generated using the javascript code snippet at [Fiat Payout Signature Generation](docId\:cz-cuTNjfgEFE_EokAwiO) .&#x20;

### **Step 3: Call &#x20;**[Create Fiat Payout Order](docId\:cz-cuTNjfgEFE_EokAwiO) API

Send the required parameters and ensure mode = `createVerify` is enable&#x64;**.**

You will have to share required fields mandated by your respective payment processor which will be shared during onboarding. &#x20;

The API creates an order and optionally checks with downstream processor with the data provided. This API will respond back with `verificationDetails`. When the downstream payment processor has mandatory verification requirement `isVerificationEnabled` flag is set to `true`. Please make sure to check the`isVerified` flag is set to `true` in the response.&#x20;

**Sample Payload with all possible fields**

```javascript
const payloadFiatPayout = {
  "currencyId": "brl_bz", // Please reach out to Pay3 team for enabled currencies in your clientId 
  "fiatAmount": "1000.00", // Fiat amount to be processed for the transaction
  "paymentMethodId": "pix", // Please reach out to Pay3 team for enabled payment methods in your clientId 
  "email": "user@example.com", //Pass the email of the user (uniqueId)
  "requestId": "...", // TODO: Application’s Order Id, send unique id for every order (preferably UUID)
  "clientId": "...", // TODO: your clientId
  "firstName": "John",
  "lastName": "Doe",
  "pixKey": "1234567890",
  "taxId": "12345678901",
  "mode": "createVerify", 
  "userId": "b418ae8f-7d1f-4c09-b32f-456abc789d12",
  "upiId": "john.doe@upi",
  "accountNumber": "123456789012",
  "bankCode": "BANK123",
  "branchCode": "BR001",
  "transferMode": "ACH",
  "callbackUrl": "https://www.example.com/callback",
  "lang": "en",
  "phoneNumber": "+1234567890",
  "userDocumentId": "doc_9876543210",
  "userDocumentType": "passport",
  "mercadoPagoUserName": "john_doe_mp",
  "address": "123 Main St, City, Country",
  "latitude": "40.712776",
  "longitude": "-74.005974",
  "userMessage": "Description."
}
```

**Sample response**

```javascript
{
    "requestId": "b8238df5-339f-4fa0-b1dd-38f432305278",
    "token": "c5fa58b3-8385-4e79-85e6-047cab79404d",
    "url": null,
    "verificationDetails": {
        "isVerificationEnabled": true,
        "isVerified": true,
        "fullName": "John Doe",
        "pixKey": "john.doe.upi"
        "accountNumber": "xxxxxx8292",
        "bankName": "Bank BRI",
        "message": "Account verified"
    }
}
```

### **Step 4:&#x20;**&#x43;all the [Execute Fiat Payout Order](docId\:A3yTB3ovV03fgjWUX7XOz)  **API.**

Using the header access token, `clientId`, `token`**,&#x20;**`requestId`**,&#x20;**&#x63;all the API. This API processes the payout and returns the final payout result.

**Sample Payload**

```javascript
const payloadFiatPayout = {
    "token":"45452aae-581d-49db-94be-ac0973e39e86",
    "requestId":"239e667a-3a54-4928-a265-09c003d7ec73",
    "clientId":"...."
}
```

**Sample Response**

```javascript
{
    "requestId": "239e667a-3a54-4928-a265-09c003d7ec73",
    "orderId": "776cd238-0d49-4a6b-b5e0-a8ca245036a2",
    "orderType": "PAYOUT",
    "status": "ORDER_PAYMENT_INITIATED"
}
```

### Step 5: Listen for Webhook Events&#x20;

Pay3 backend sends webhook notifications with status updates.
Upon receiving an event, you may call the [Get Fiat Order Details](docId\:EvzG5iQKqdzSR1_pKKNDs)  to retrieve the latest payout details.

***


[title] Crypto Payout Server-Side API
[path] Getting Started/

This document explains how to create a crypto payout order and process user withdrawals using a backend-only, server-to-server API without any user interface.

The [Create Crypto Payout Order](docId:_Ma9YwvAYBFe7QKrHQhWG)  API creates a payout order and returns the parameters required to process the withdrawal.  When **mode=createExecute** is passed, no website URL or UI is generated. Instead, the API response includes the `token` and `requestId`, along with the `estimatedFees` and `estimatedNetAmount` for the payout.

Once you receive these parameters, your backend can call the [Execute Crypto Payout Order](docId:9yybPniBl2CorbCYh2dz7)  API to complete the withdrawal. This final API asyncronously submits the transaction to blockchain.

Pay3 backend sends events to your backend service with real-time updates on the payout status. When you receive an event, you may call the [Get Crypto Order Details](docId\:NzZQBlpdfmg7MFy3OtpVs)**&#x20;&#x20;**&#x41;PI to fetch the latest payout information.
**Note**: Refer to the `receivedAmount` field to verify the paid sum.

## **Steps**

### **Step 1:&#x20;**&#x47;et Access Token&#x20;

To generate the Access Token, you will call the API with the api-secret and client-id. Please refer to the [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA).&#x20;

### **Step 2:&#x20;**&#x43;reate a Signature with Parameters

The payout request requires a signature in the header. This can be generated using the javascript code snippet here [Signature Generation](docId:_Ma9YwvAYBFe7QKrHQhWG) .&#x20;

### **Step 3: Call&#x20;**[Create Crypto Payout Order](docId:_Ma9YwvAYBFe7QKrHQhWG) API

Send the required parameters and ensure mode = 'createEstimate' is enable&#x64;**.&#x20;**&#x54;he response will include: `token`**,&#x20;**`requestId`**,&#x20;**`currency`**,&#x20;**`address`**,&#x20;**`estimatedFees`**,&#x20;**`estimatedNetAmount`**.&#x20;**

Sample Payload

```javascript
const payloadCryptoPayout = {
 "requestId": "a1d4a50e-5577-4581-a980-98b03bc76260", // TODO: Application’s Order Id, send unique id for every order (preferably UUID)
 "address": "tb1.....", // TODO: add your address to receive the USDT
 "currency": "btc_bitcointestnet", // Please reach out to Pay3 team for enabled currencies in your clientId 
 "amount": "0.001", // Amout of Bitcoin (in this case)
 "clientId":"....",// TODO: your clientId
 "payerEmail": "user@email.com",  //pass the email of the user (uniqueId)
 "mode": "createEstimate"
}

```

Sample response

```javascript
{
    "token": "a003d60c-d0ae-40e5-a7cb-2634ab607253",
    "requestId": "a1d4a50e-5577-4581-a980-98b03bc76260",
    "currency": "btc_bitcointestnet",
    "address": "tb1q7sqtxktz3jle8evmfnnhv45s0maudwdtknmdqu",
    "warning": "The btc_bitcointestnet balance (0.0031) is below the configured threshold (100.0000).",
    "estimatedFees": "0.000066",
    "estimatedNetAmount": "0.000034"
}
```

### **Step 4:&#x20;**&#x43;all the [Execute Crypto Payout Order](docId:9yybPniBl2CorbCYh2dz7)**&#x20;API.**

Using the `clientId`, `token`**,&#x20;**`requestId` call this API. This API processes the payout and returns the final payout result.

Sample Payload

```javascript
const payloadCryptoPayout = {
    "token":"a003d60c-d0ae-40e5-a7cb-2634ab607253",
    "requestId":"a1d4a50e-5577-4581-a980-98b03bc76260",
    "clientId":"...."
}
```

Sample Response

```javascript
{
    "txnHash": "...",
    "orderType": "PAYOUT",
    "orderId": "3b5a941c-efef-4125-9237-3216ddd6f607",
    "requestId": "a1d4a50e-5577-4581-a980-98b03bc76260",
    "status": "ORDER_PAYMENT_PROCESSING"
}
```

### Step 5: Listen for Webhook Events&#x20;

Pay3 backend sends webhook notifications with status updates.
Upon receiving an event, you may call the [Get Crypto Order Details](docId\:NzZQBlpdfmg7MFy3OtpVs)  to retrieve the latest payout details.

***


[title] Create Crypto Refund
[path] Pay3 API Documentation/

This API creates a crypto refund order to enable merchants to refund a successfully processed crypto  transaction. It accepts amount, orderId and the other order details.  &#x20;

This API requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Create Refund ",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/crypto-refund/create-order",
  "description": "Create an order with refund details from your application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "eXhyHL9RWXfgU_lG6oq1Q",
        "language": "curl",
        "code": "curl --location 'https://api.pprod.pay3.app/v1/client/crypto-refund/create-order' \\\n--header 'signature: {{signature}}' \\\n--header 'Access-token: {{access-token}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"clientId\":\"\",\n    \"requestId\":\"\",\n    \"orderId\":\"\",\n    \"amount\": \"1.0\",\n    \"currency\": \"usdc_sepolia\",\n    \"address\": \"0x..\",\n    \"mode\":\"returnUrl\",\n    \"sponsorFee\":false\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "eXhyHL9RWXfgU_lG6oq1Q"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "{\n    \"token\": \"d0614ad6-91a5-4bf4-8e87-f4907b5b8fce\",\n    \"requestId\": \"4a7ee93e-7eb7-4e80-9cc7-4faf804bc183\",\n    \"url\": \"https://pay3-sample-payment-Url\"\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "signature",
        "kind": "required",
        "type": "string",
        "description": "Signature generated with sha256 followed by base64 encoding. Check below section for more details",
        "children": []
      },
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "orderId",
        "kind": "required",
        "type": "string",
        "description": "The orderId of the parent order, this can be found in the dashboard or from Order details API.",
        "": "The orderId of the parent order, this can be found in the dashboard or from Order details API."
      },
      {
        "name": "amount",
        "kind": "required",
        "type": "string",
        "description": "Amount user can be refunded in string format. This amount should be less than or equal to the parent order amount. Maximum two decimal places are allowed.",
        "": "Amount user can be refunded in string format. This amount should be less than or equal to the parent order amount. Maximum two decimal places are allowed."
      },
      {
        "name": "mode",
        "kind": "required",
        "type": "string",
        "description": "When the mode is set to returnUrl, the API response includes an additional field url, which provides a direct  page link for processing crypto refunds. The supported values for mode are returnUrl.",
        "": "When the mode is set to returnUrl, the API response includes an additional field url, which provides a direct  page link for processing crypto refunds. The supported values for mode are returnUrl."
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "sponsorFee",
        "kind": "optional",
        "type": "string",
        "description": "When sponsorFee is set to false(default), the amount is sent to the destination address (user's address) after deducting the gas fees.\n\nWhen sponsorFee is set to true, the complete amount is sent to the destination address.\n",
        "": "When sponsorFee is set to false(default), the amount is sent to the destination address (user's address) after deducting the gas fees.\n\nWhen sponsorFee is set to true, the complete amount is sent to the destination address.\n"
      },
      {
        "name": "userId",
        "kind": "optional",
        "type": "string",
        "description": "Pass any string for the user (uniqueId) to identify and map the orders against the user. This can be same value which you are using in your application to uniquely identify the users.",
        "": "Pass any string for the user (uniqueId) to identify and map the orders against the user. This can be same value which you are using in your application to uniquely identify the users."
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "create-refund",
  "legacyHash": "ndwJglHmBpAR2On-P5bTb"
}
```
:::

## Signature Generation

The request for creating payout order requires a header `signature`. This can be generated using following javascript code snippet.&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const fiatAmount =  "0.02";
const fiatCurrency = "aed_ae";
const orderId = "Order_ID_Of_the_Pay-in_Order";
const requestId = "Order-Id-Generated-By-Application";

const getSignature = (secretKey, fiatAmount, fiatCurrency , orderId ,requestId) => {
    // Prepare the string to sign in same format. 
    // fiatAmount followed by requestId
    const stringToSign = 'fiatAmount=' + fiatAmount + '&fiatCurrency=' + fiatCurrency + '&orderId=' + orderId + '&requestId=' + requestId;
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, fiatAmount, fiatCurrency , orderId ,requestId);

```

***


[title] Payment Methods
[path] Pay3 API Documentation/

Payment methods api returns a list of supported payment methods and their names given `clientId` and `type`. The `type` parameter can take in string values like `CHECKOUT`  or `PAYOUT`.&#x20;

The response is a list of payment methods which has&#x20;

1. `paymentMethodKey` is a string which specifies payment type that can be passed in [create payout order](docId\:cz-cuTNjfgEFE_EokAwiO) and [open checkout](docId\:Wr9g8-0vvAo95lsm3g1ye)
2. `paymentMethod` is the name of the payment method key
3. `currencyId` is the currency for which the payment method is supported. eg: `brl_bz` is Brazilian Real&#x20;

:::ApiMethodV2
```json
{
  "name": "Get Payment Methods",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v2/client/payment-methods?clientId=your-client-id&type=type",
  "description": "Get order details by client's request-id",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "bRKPtJIoiXMBYsHZXcnZI",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v2/client/payment-methods?clientId=your-client-id&type=type' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "bRKPtJIoiXMBYsHZXcnZI"
  },
  "results": {
    "languages": [
      {
        "id": "GC_lbEEV7Jo_hgFNI1cHK",
        "language": "200",
        "customLabel": "",
        "code": "{\n  \"PaymentMethods\": [\n    {\n      \"paymentMethodKey\": \"boleto\",\n      \"paymentMethod\": \"Boleto\",\n      \"currencyId\": \"brl_bz\"\n    },\n    {\n      \"paymentMethodKey\": \"pix\",\n      \"paymentMethod\": \"Pix\",\n      \"currencyId\": \"brl_bz\"\n    },\n    {\n      \"paymentMethodKey\": \"credit_card\",\n      \"paymentMethod\": \"Credit Card\",\n      \"currencyId\": \"brl_bz\"\n    }\n  ]\n}"
      },
      {
        "id": "Ybev9LI4TwGz-n2zW-919",
        "language": "401",
        "customLabel": "",
        "code": "{\"error\":\"Client verification failed\"}"
      }
    ],
    "selectedLanguageId": "GC_lbEEV7Jo_hgFNI1cHK"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client Id",
        "children": []
      },
      {
        "name": "type",
        "kind": "required",
        "type": "string",
        "description": "can take values either CHECKOUT or PAYOUT",
        "children": []
      }
    ],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "get-payment-methods",
  "legacyHash": "Ho9iJEC_JPPN0AYuwz2_u"
}
```
:::

***


[title] JS SDK Quick Start
[path] Getting Started/

Get started with Pay3 Javascript SDK with a few lines of code. Pay3 SDK is designed to **work in any javascript-based client-side application** and work with most of the popular frontend frameworks like React. Pay3 also provides SDKs for React Native, Flutter and Unity.&#x20;

# Install

The Pay3 JS SDK is available at the public npm registry [@pay3/sdk](https://www.npmjs.com/package/@pay3/sdk) . You can install and add to your App using the following command.

```shell
npm install @pay3/sdk --save
```

# Initialization

Import the package installed in the previous step using **import** directive. Create a instance of Pay3 by passing the parameters you received during onboarding. [Reference](docId\:mXTd0GUnCKc5vOtU8Masq)

:::CodeblockTabs
index.js

```javascript
// Import Pay3 package
import { initPay3 } from '@pay3/sdk';

// New Instance
const pay3 = initPay3({ 
                hostname: "https://pay3-hostname-shared-by-pay3", 
                clientId: "client-uuid-shared-by-pay3",
                isPaymentMode: true 
         });
```
:::

# Fiat Payin

Pay3 Web Modal provides a comprehensive digital asset purchase buy flow. User is able to choose a payment method and buy the digital asset using currencies across the globe.&#x20;

The request object requires a string `requestId` . This will be passed back along with the event emitted on completion of the buy flow.  Detailed documentation of `openCheckout` is present at [Transactions](docId\:Wr9g8-0vvAo95lsm3g1ye)

:::CodeblockTabs
index.js

```javascript
pay3.openCheckout({
  requestId: "dapp-can-pass-unique-id"
  "user": {
    "email": "user-email@address"
  },
  "payment": [
    {
      "amount": "2.00",
      "name": "brl_bz",
    },
    {
      "amount": "4.05",
      "name": "usd_usa",
    }
  ],
  "userMessage": "Checkout Sample"
});
```
:::

# Fiat Payout

Pay3 Web Modal provides a withdraw functionality to users where they can receive funds in their local currency. User will be able to provide either bank details or local e-wallets to receive the funds. Detailed documentation of `openPayout` is present at [Transactions](docId\:Wr9g8-0vvAo95lsm3g1ye)

The request object requires a string `requestId` and the `token` which is a unique id generated by Pay3 backend on calling [create payout order](docId\:cz-cuTNjfgEFE_EokAwiO).&#x20;

:::CodeblockTabs
index.js

```javascript
 // Opens Pay3 Payout modal
 pay3Pay.openPayout( {
  "requestId": requestId,
  "token": pay3CreatedTokenId
});
```
:::

# Crypto Payin

This function opens Pay3 buy crypto modal. The Buy modal will guide the user through the digital asset purchase flow using user's own digital assets like Coins and ERC20 tokens. Detailed documentation of `openCryptoCheckout` is present at [Transactions](docId\:Wr9g8-0vvAo95lsm3g1ye)

The request object requires a string `requestId` and the `token` which is a unique id generated by Pay3 backend on calling create [create crypto checkout order](docId\:twxeK26s1FEfj4VBXDnO7).

:::CodeblockTabs
index.js

```javascript
// Opens Pay3 Crypto Checkout Modal
pay3.openCryptoCheckout({
  "requestId": requestId,
  "token": pay3CreatedTokenId
});
```
:::

# Listen to transaction status events

On completion of the transaction flow an event is emitted with type `pay3-sdk-transaction-status`. The event data consists of fields `status` which is set to 'SUCCESS' when transaction  is completed successfully. The `orderId` is Pay3's transaction ID and `requestId` is the unique string passed by the application in `openCheckout` call. &#x20;

:::CodeblockTabs
index.js

```javascript
pay3.on('pay3-sdk-transaction-status', (event) => {
  console.log("[dApp] received transaction status", event.data);
  const {status, orderId, requestId, message} = event.data;
});
```
:::

***


[title] Event Listeners
[path] Untitled/

After completing transactions in Pay3 SDK UI, the Pay3 SDK publishes events via Firebase real-time database for all native SDKs. The listener can be registered after successfully completing the anonymos login in Firebase which happens during initialisation.

### pay3-sdk-transaction-status

This event is fired by Pay3 SDK in following scenario &#x20;

1. On completion of Checkout transaction triggered by `TriggerOpenCheckout`

**Snapshot Payload**

1. `data` (Type Object): Following keys are present in this object&#x20;
   1. `status` (Type string): The status can have values SUCCESS or ERROR.
   2. `message` (Type string): User-friendly message returned after completion of the transaction.
   3. `orderId` (Type string): Pay3 Order ID. &#x20;
   4. `requestId` (Type string): Unique id passed by App.
2. `error` (Type Object, Optional): Following keys will be present if there is an error. Please refer to [SDK Errors](docId\:upvtC67WkwGNCSCjVAQ0v) for reference.
   1. &#x20;`code` (Type number): Error code.
   2. `message` (Type string):  Error message.

:::CodeblockTabs
Pay3Helper.cs&#x20;

```cpp
   public class Pay3Helper : MonoBehaviour {
   // Pseudocode to attach a listner to receive transaction status 
    // events with in the Unity application 
    private void StartTransactionListener() {
      FirebaseDatabase.GetInstance(fbApp)
        .GetReference("/app_notifications/"+fbUserId+"/pay3-sdk-transaction-status")
        .ValueChanged += (object sender2, ValueChangedEventArgs event) => {
          // Extract event data from snapshot object returned by the event listener
        };
    }
  }  
```
:::

***


[title] Pay3-Pay
[path] /

### Why should I use Pay3-Pay?

With Pay3-Pay, you can configure multiple payment partners and popular payment methods with a single integration and offer a seamless checkout option for your game tokens and other in-game assets. The integration can be done with one line of code enabling you a top-notch experience for your users.

Expanding our payment offerings to include popular local options for our users is a priority. Additionally, we recognize the importance of having fallback options for payment providers. Nonetheless, assessing and integrating these providers in all the countries where our product is available is a substantial undertaking, demanding ongoing commitment and resources from our team.

**Buy Game Token Flow**

![Buy Game Token Flow](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/ldycIrpt94H-4bJv5c3hl_buy-game-tokens.png "Buy Game Token Flow")

**Sell Game Token Flow**

![Sell Game Token Flow](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/6IaGsWPtuSNjz2S8aZphm_sell-game-tokens.png "Sell Game Token Flow")

**NFT Buy Flow**

![NFT Buy Flow](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/sKVejeuWzW6Dx_uU0dNgz_nft-buy-flow.png "NFT Buy Flow")

### What are the different payment methods we offer?

Pay3-Pay offers a variety of payment options such as

a) Credit and Debit Cards- VISA and Mastercard

b) Bank Transfers- UPI, SEPA, ACH

c) Mobile Wallets- Apple Pay, Google Pay, Paypal, Cash App

d) Popular Local Payment Options  Gcash, DragonPay, Grab Pay, Pix and PayNow

**Who are our payment partners?**

We are connected with popular on-ramps and liquidity providers such as Transak, Simplex, Alchemy Pay, OnMeta, Uniswap, Onramp.money and 1Inch to offer you the best and lowest-cost payment experience.&#x20;

**What countries do we support?**

We are committed to providing our services to users around the world. However, due to legal and regulatory requirements, we will not be able to support any individuals or countries sanctioned by the regulations of the jurisdictions where we operate. These lists are updated periodically and will be available as part of our Terms of Service. Please refer to our Pricing section to see our supported countries.

**Where can you integrate Pay3-Pay?**

dApp or mobile app: You can integrate Pay3-Pay directly into your website or mobile app to allow users to buy or sell game tokens and assets seamlessly. This can involve embedding a payment widget or integrating an API that facilitates cryptocurrency transactions.

API integration: If you have a custom-built solution or require more flexibility in your integration, you can integrate a crypto onramp and offramp using APIs (Application Programming Interfaces) provided by us. This can involve implementing API calls to initiate and manage in-game transactions from your own software or platform.

NFT Checkout: Our NFT Checkout integration provides a fast and secure way for web3 NFT platforms to enable their users to buy NFTs using credit, debit cards, and local payment methods from 100+ countries.

**How will I get reports around Transactions and Analytics?**
Our comprehensive client dashboard provides insightful user Activity Reports which offers key metrics such as:

1. Transaction Value
2. Transaction Volume

**How does Pay3-Pay ensure security?**
Pay3-Pay encrypts sensitive data at rest and in transit using strong encryption algorithms to prevent unauthorised access. We also implement firewalls, intrusion detection prevention systems, and other security measures to protect the company's network and data from cyber-attacks. Additionally, we regularly scan our systems for vulnerabilities and fix them to prevent potential attacks.

**What are Pay3-Pay's risk and fraud protection procedures?**
Pay3-Pay incorporates risk and fraud protection measures including fraudulent payments and unauthorised access to an account.

**How will we get support from Pay3?**

We will have dedicated representatives to support you during integration and launch. Our customer support team will be available 24\*7 at [help@pay3.money]()  or [](https://t.me/pay3_money) to answer any queries you may have once the service goes live. We will respond to your queries within 24 hours.&#x20;

We will also work with you to design your User FAQ for the payment sections of your offering.

**What is the process to become a partner of Pay3-Pay? How long does it take?**

Pay3-Pay will need information about your business and will request for information during the due diligence process. A link to our sample request is [here](https://docs.google.com/document/d/1mPggsCNbaHxMX3Vyjzdk3qpY7oOOzP1p6k1d_Dta5aY/edit?usp=sharing)

***


[title] Execute Crypto Payout Order
[path] Pay3 API Documentation/

This API is used to execute a crypto payout order and complete the user’s withdrawal. It accepts `token` , `requestId` and `clientId`

:::hint{type="info"}
Call this api after generating token from [Crypto Payout Order with mode=createEstimate](docId:_Ma9YwvAYBFe7QKrHQhWG)&#x20;
:::

:::ApiMethodV2
```json
{
  "name": "Execute Crypto Payout Order",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/crypto-payout/execute",
  "description": "Execute an order with payout details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "nyfSHp7J-NrsuqTH3FW7t",
        "language": "curl",
        "code": "curl --location 'https://api.dev.pay3.app/v1/client/crypto-payout/execute' \\\n--header 'signature: {{signature}}' \\\n--header 'access-token: {dynamic-access-toke}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"token\":\"a003d60c-d0ae-40e5-a7cb-2634ab607253\",\n    \"requestId\":\"a1d4a50e-5577-4581-a980-98b03bc76260\",\n    \"clientId\":\"....\"\n}'\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "nyfSHp7J-NrsuqTH3FW7t"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "{\n    \"txnHash\": \"...\",\n    \"orderType\": \"PAYOUT\",\n    \"orderId\": \"3b5a941c-efef-4125-9237-3216ddd6f607\",\n    \"requestId\": \"a1d4a50e-5577-4581-a980-98b03bc76260\",\n    \"status\": \"ORDER_PAYMENT_PROCESSING\"\n}",
        "customLabel": ""
      },
      {
        "id": "tIvoQbUSKGnrqallvNDVQ",
        "language": "401",
        "code": "{\n    error: {\n      code: '7001',\n      message: 'Order already exists for given requestId'\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "token",
        "kind": "required",
        "type": "string",
        "description": "The token received from the Create Crypto Payout Order API with mode=createEstimate",
        "": "The token received from the Create Crypto Payout Order API with mode=createEstimate"
      },
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. Pass the same Id used while creating payout order.",
        "": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. Pass the same Id used while creating payout order."
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier. ",
        "": "Client id. Application's identifier. "
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "orderId",
      "kind": "optional",
      "type": "string",
      "description": "The unique identifier generated by Pay3 for this payout order. This ID can be used for referencing the payout in logs, dashboard views, API queries, and webhook events.",
      "children": []
    },
    {
      "name": "requestId",
      "kind": "optional",
      "type": "string",
      "description": "The same requestId provided during payout creation and execution. Returned here for consistency, allowing applications to correlate the execution response with the original payout request.",
      "children": []
    },
    {
      "name": "txnHash",
      "kind": "optional",
      "type": "string",
      "description": "The blockchain transaction hash generated after the payout is broadcasted to the network. This can be used to track the payout on the respective blockchain explorer. This can be null if the order is still processing."
    },
    {
      "name": "orderType",
      "kind": "optional",
      "type": "string",
      "description": "Indicates the type of order being processed. For this API, the value will always be PAYOUT, confirming that the request corresponds to a withdrawal operation.",
      "children": []
    },
    {
      "name": "status",
      "kind": "optional",
      "type": "string",
      "description": "Indicates the current stage or final outcome of the payout execution. The possible statuses include:\n\n-  ORDER_PAYMENT_PROCESSING: The payout request is under process. You will receive status updates via Webhook. Please call the Crypto Order Details api for details. \n\n- FAILED: The payout could not be processed.  ",
      "children": []
    }
  ],
  "autoGeneratedAnchorSlug": "execute-crypto-payout-order",
  "legacyHash": "sqj7sRsDC04r4g-8bBx8B"
}
```
:::

##

***


[title] End User Flow - Fiat Payin
[path] Untitled/

You can purchase Game credit and other in-game assets using popular Fiat payment methods. For reference, we will go over the flow of Fiat Payment with the Card payment method in United States:

- When the Buy Game credit flow starts, the user is presented with the screen which will comprise the fiat amount and currency and the preferred payment method in the chosen country.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/iulZpNMQ8L5vezPD5gr6A_image-8253.png" size="50" width="1676" height="1392" position="center" showCaption="false"}

- Once the user confirms the above transaction specifics, they will be presented with the checkout screen to finish the payment.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/jMuVmEQDxjCjxSEoRYWKN_image-8254.png" size="50" width="1680" height="3212" position="center" showCaption="false"}

- Upon confirmation, the transaction is processed and relevant status of the transaction is presented to the user.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/T7smqnNn_ZQK6zgf2BypM_image-8255.png" size="50" width="1680" height="1590" position="center" showCaption="false"}

***


[title] FAQ's
[path] Overview/

### Why should you integrate Pay3-Checkout?

Pay3-Checkout allows you to set up widely used payment methods across multiple geographies including popular local payment methods with just one integration. It also provides a smooth checkout process for your in-game credits. A few lines of code is all that is needed to complete the integration to give your user's a seamless experience. Pay3 offers multi-networks for a better payment experience and our properitery AI routing engine lowers the cost and increases the success rate.

### What are the different payment methods Pay3 offers?

Pay3-Checkout offers a variety of payment options such as
a) Credit and Debit Cards- VISA and Mastercard
b) Bank Transfers- UPI, SEPA, ACH
c) Mobile Wallets- Apple Pay, Google Pay, Paypal, Cash App
d) Popular Local Payment Options  Gcash, DragonPay, Grab Pay, Pix, PayNow and many more.

![](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/BDpFPg-Iker6RM8pynkrw_main.png)

### Where can you integrate Pay3-Checkout?

You can integrate Pay3-Checkout directly into your website or mobile app to allow users to buy game credits. This can involve embedding a payment widget or integrating an API that facilitates transactions.

### What countries and currencies do we support?

We are committed to providing our services to users around the world. However, due to legal and regulatory requirements, we will not be able to support any individuals or countries sanctioned by the regulations of the jurisdictions where we operate. These lists are updated periodically and will be available as part of our Terms of Service. Please refer to our [Payment Coverage](https://docs.pay3.money/fiat-docs/payment-coverage) to see our supported countries along with the available payment methods.

### &#xA;How will you get reports around Transactions and Analytics?&#x20;

Our comprehensive client dashboard provides insightful user Activity Reports that offer key metrics such as:

1\. Transaction Value
2\. Transaction Volume

### &#xA;How does Pay3-Checkout ensure security?

Pay3-Checkout encrypts sensitive data at rest and in transit using strong encryption algorithms to prevent unauthorised access. We also implement firewalls, intrusion detection prevention systems, and other security measures to protect the company's network and data from cyber-attacks. Additionally, we regularly scan our systems for vulnerabilities and fix them to prevent potential attacks.

### &#xA;What are Pay3-Checkout's risk and fraud protection procedures?&#x20;

Pay3-Checkout incorporates risk and fraud protection measures including fraudulent payments and unauthorised access to an account.

### &#xA;How will you get support from Pay3?

We will have dedicated representatives to support you during integration and launch. Our customer support team will be available 24\*7 at [help@pay3.money](mailto\:help@pay3.money) or[ telegram](https://t.me/pay3_money) to answer any queries you may have once the service goes live. We will respond to your queries within 24 hours.

We will also work with you to design your User FAQ for the payment sections of your offering.

### &#xA;What is the process to become a partner of Pay3-Checkout? How long does it take?

Pay3-Checkout will need information about your business and will request for information during the due diligence process. If all the documents are in order, we can get you up and running in a week.

[title] Initialize using npm
[path] Pay3 Javascript SDK/

## Install dependency&#x20;

Install `@pay3/sdk` package using package manager which adds it to your `packages.json` &#x20;

:::CodeblockTabs
index.js

```shell
npm install --save @pay3/sdk
```
:::

The above command will add pay3 js sdk to dependencies section of your `package.json`

:::CodeblockTabs
index.js

```shell
"dependencies": {
    ...
    "@pay3/sdk": "^1.6.4",
    ...
}
```
:::

## initPay3()

Pay3 SDK supports Fiat Checkout flow using payment only mode.

*Pay3 team* shares `hostname` and `clientId` during onboarding. Following parameters can be used for creating new instance of Pay3.&#x20;

**Parameters**

1. **hostname**: Pay3 will be opened in a new window using this hostname prefix. The host name is environment dependent.&#x20;
2. **clientId**: A unique client ID is created for each client application. The client ID is environment dependent.
3. **isPaymentMode** : Pass `true` for fiat checkout in payments only mode.&#x20;
4. **lang&#x20;**(optional, default value '**en**'):  This parameter specifies the language preference for the Pay3 SDK. The strings used follow two letter language code as in ISO 639-1. Example **pt** for Portuguese, **en** for English.

:::CodeblockTabs
index.js

```javascript
import { initPay3, Pay3 } from '@pay3/sdk';

const pay3Pay: Pay3 = initPay3({ clientId, hostname, isPaymentMode: true, lang: 'en' });
```
:::

***


[title] Execute Fiat Payout Order
[path] Pay3 API Documentation/

This API is used to execute a fiat payout order and complete the user’s withdrawal. It accepts header `access token`, `token` , `requestId` and `clientId`

:::hint{type="info"}
Call this api after generating token from [Create Fiat Payout Order mode=createVerify](docId\:cz-cuTNjfgEFE_EokAwiO)&#x20;
:::

This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Execute Fiat Payout Order",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/payout/execute",
  "description": "Create an order with payout details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "eXhyHL9RWXfgU_lG6oq1Q",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/payout/create-order' \\\n--header 'signature': \"generated-signature\"\\\n--header 'access-token' : \"dynamic-access-token\" \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"token\":\"45452aae-581d-49db-94be-ac0973e39e86\",\n    \"requestId\":\"239e667a-3a54-4928-a265-09c003d7ec73\",\n    \"clientId\":\"....\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "eXhyHL9RWXfgU_lG6oq1Q"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "{\n    \"requestId\": \"239e667a-3a54-4928-a265-09c003d7ec73\",\n    \"orderId\": \"776cd238-0d49-4a6b-b5e0-a8ca245036a2\",\n    \"orderType\": \"PAYOUT\",\n    \"status\": \"ORDER_PAYMENT_INITIATED\"\n}",
        "customLabel": ""
      },
      {
        "id": "66DvgM2SsFyRRj4NnmNJ1",
        "language": "400",
        "code": "{\n    error: {\n      code: '7001',\n      message: 'Order already exists for given requestId'\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. ",
        "": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. "
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "token",
        "kind": "required",
        "type": "string",
        "description": "A unique token returned after creating the payout/verification order. This token must be passed to the Execute API to complete the processing flow.",
        "": "required"
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "response": [
    {
      "name": "requestId",
      "kind": "optional",
      "type": "string",
      "description": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application. "
    },
    {
      "name": "orderId",
      "kind": "optional",
      "type": "string",
      "description": "The internal Pay3-generated identifier for this payout order. This can be used for tracking, reconciliation, and fetching detailed order information through the Order Details API.",
      "children": []
    },
    {
      "name": "orderType",
      "kind": "optional",
      "type": "string",
      "description": "Indicates the type of order being processed. For this API, the value will always be \"PAYOUT\", confirming that the request corresponds to a withdrawal operation.",
      "children": []
    },
    {
      "name": "status",
      "kind": "optional",
      "type": "string",
      "description": "Indicates the current stage or final outcome of the payout execution. The possible statuses include:\n\n- ORDER_PAYMENT_INITIATED: The payout has been triggered and processing has begun.\n- FAILED: The payout could not be processed due to an error from the partner, bank, or network.\n",
      "children": []
    }
  ],
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "execute-fiat-payout-order",
  "legacyHash": "mXfLMxmKKFuBlvI3p8dgN"
}
```
:::

***


[title] Create Fiat Payout Order
[path] Pay3 API Documentation/

This API creates a payout order to enable users to withdraw funds. It accepts amount and currency details. On creating an order a dynamic `token` is returned from this api which is required to be passed to [pay3Pay.openPayout()](docId\:Wr9g8-0vvAo95lsm3g1ye)&#x20;

This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

**Note**: Actual response may change based on partner integration.

:::ApiMethodV2
```json
{
  "name": "Create Fiat Payout Order",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/payout/create-order",
  "description": "Create an order with payout details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "eXhyHL9RWXfgU_lG6oq1Q",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/payout/create-order' \\\n--header 'signature': \"generated-signature\"\\\n--header 'access-token' : \"dynamic-access-token\" \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"currencyId\": \"currency-id\",\n    \"fiatAmount\": \"0.02\",\n    \"requestId\": \"9824649238\",\n    \"paymentMethodId\": \"payment-method-id\",\n    \"email\": \"user@address.com\",\n    \"clientId\": \"your-client-id\",\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"taxId\": \"tax-id\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "eXhyHL9RWXfgU_lG6oq1Q"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "code": "{\n    \"requestId\": \"3966274f-f8b2-4992-9313-56962699b2fa\",\n    \"token\": \"f52d592a-a67a-4037-b8a2-8b7020332c6d\",\n    \"url\": null,\n    \"warning\": \"The payout account balance (999999999992444999.55) is below the configured threshold (999999999992549599.55).\",\n    \"verificationDetails\": {\n        \"isVerificationEnabled\": true,\n        \"isVerified\": true,\n        \"fullName\": \"John Doe\",\n        \"accountNumber\": \"xxxxxx8292\",\n        \"bankName\": \"Bank BRI\",\n        \"message\": \"Account verified\"\n        \"fullName\": \"John Doe\",\n        \"pixKey\": \"user@address.com\"\n    }\n}\n",
        "customLabel": ""
      },
      {
        "id": "66DvgM2SsFyRRj4NnmNJ1",
        "language": "400",
        "code": "{\n    error: {\n      code: '7001',\n      message: 'Order already exists for given requestId'\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "signature",
        "kind": "required",
        "type": "string",
        "description": "Signature generated with sha256 followed by base64 encoding. Check below section for more details",
        "children": []
      },
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application",
        "children": []
      },
      {
        "name": "currencyId",
        "kind": "required",
        "type": "string",
        "description": "Currency id supported in the payout flow. This will be provided by Pay3 during onboarding"
      },
      {
        "name": "fiatAmount",
        "kind": "required",
        "type": "string",
        "description": "Amount user can withdraw in string format. Maximum two decimal places are allowed",
        "children": []
      },
      {
        "name": "paymentMethodId",
        "kind": "required",
        "type": "string",
        "description": "Unique string identifier. This will be provided by Pay3 during onboarding ",
        "children": []
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "email",
        "kind": "required",
        "type": "string",
        "description": "User email to identify the user, which will be available in reporting dashboard",
        "children": []
      },
      {
        "name": "taxId",
        "kind": "required",
        "type": "string",
        "description": "Tax ID issued to the user by their country",
        "": "required"
      },
      {
        "name": "userId",
        "kind": "optional",
        "type": "string",
        "description": "It is a type of UUID. It will used as unique identifier of the user. If this is not passed, email will be used as a unique identifier of the user within Pay3.",
        "": "It is a type of UUID. It will used as unique identifier of the user. If this is not passed, email will be used as a unique identifier of the user within Pay3."
      },
      {
        "name": "firstName",
        "kind": "optional",
        "type": "string",
        "description": "Optional first name of the user",
        "children": []
      },
      {
        "name": "lastName",
        "kind": "optional",
        "type": "string",
        "description": "Optional last name of the user",
        "children": []
      },
      {
        "name": "pixKey",
        "kind": "optional",
        "type": "string",
        "description": "PIX Key is a unique identifier that links to a Brazilian user’s bank account and determines where the funds will be received.",
        "children": []
      },
      {
        "name": "mode",
        "kind": "optional",
        "type": "string",
        "description": "returnUrl - In this mode, the API returns a Pay3 payment URL that can be embedded directly into the client’s application. This is useful when the client wants to open the Pay3 URL inside a WKWebView (iOS), WebView (Android/React Native), or an <iframe> in a web app.\n\nreturnAppUrl - In this mode, the API will return supported Android / iOS application url. This requires valid targetApp parameter in the body.\n\ncreateVerify - In this mode, the API does not generate any website URL or UI. Instead, it returns the verification details required by the downstream partner. These fields allow the partner to verify the beneficiary and then process the payout directly based on the verified information.",
        "": "returnUrl - In this mode, the API returns a Pay3 payment URL that can be embedded directly into the client’s application. This is useful when the client wants to open the Pay3 URL inside a WKWebView (iOS), WebView (Android/React Native), or an <iframe> in a web app.\n\nreturnAppUrl - In this mode, the API will return supported Android / iOS application url. This requires valid targetApp parameter in the body.\n\ncreateVerify - In this mode, the API does not generate any website URL or UI. Instead, it returns the verification details required by the downstream partner. These fields allow the partner to verify the beneficiary and then process the payout directly based on the verified information."
      },
      {
        "name": "callbackUrl",
        "kind": "optional",
        "type": "string",
        "description": "Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter data query parameter will be added to the url. ",
        "": "callbackUrl"
      },
      {
        "name": "lang",
        "kind": "optional",
        "type": "string",
        "description": "This parameter specifies the language preference for the Pay3 SDK. The strings used follow two letter language code as in ISO 639-1. Example pt for Portuguese, en for English.",
        "": "lang"
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "response": [
    {
      "name": "requestId",
      "kind": "optional",
      "type": "string",
      "description": "Identifier that is created by Application's backend. This will be passed in relevant events and webhooks from Pay3 to Application"
    },
    {
      "name": "token",
      "kind": "optional",
      "type": "string",
      "description": "A unique token returned after creating the payout/verification order. This token must be passed to the Execute API to complete the processing flow.",
      "children": []
    },
    {
      "name": "url",
      "kind": "optional",
      "type": "string",
      "description": "Returned only when the mode supports UI flow (mode = returnUrl). When no UI is required (mode = createVerify) this field will be null.",
      "children": []
    },
    {
      "name": "warning",
      "kind": "optional",
      "type": "string",
      "description": "May provide additional information or caution related to the payout session, eg. Payout wallet balance is lesser than threshold. ",
      "children": []
    },
    {
      "name": "verificationDetails",
      "kind": "optional",
      "type": "object",
      "description": "This block contains the results of the beneficiary verification process, including indicators of whether verification is required and completed, along with the validated user information returned by the downstream partner.",
      "children": [
        {
          "name": "isVerificationEnabled",
          "kind": "optional",
          "type": "boolean",
          "description": "Indicates whether verification is required for this transaction flow based on configuration or partner rules."
        },
        {
          "name": "isVerified",
          "kind": "optional",
          "type": "boolean",
          "description": "Shows whether the user’s account or payment details have been successfully verified by the downstream partner."
        },
        {
          "name": "fullName",
          "kind": "optional",
          "type": "string",
          "description": "The full verified name of the user returned by the partner."
        },
        {
          "name": "pixKey",
          "kind": "optional",
          "type": "string",
          "description": "The verified PIX key associated with the user."
        },
        {
          "name": "accountNumber",
          "kind": "optional",
          "type": "string",
          "description": "A masked version of the verified account number returned by the partner."
        },
        {
          "name": "bankName",
          "kind": "optional",
          "type": "string",
          "description": "The name of the bank with which the user’s payment account is registered."
        },
        {
          "name": "message",
          "kind": "optional",
          "type": "string",
          "description": "A partner-provided message summarizing the verification outcome (e.g., \"Account verified\")."
        }
      ]
    }
  ],
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "create-fiat-payout-order",
  "legacyHash": "mXfLMxmKKFuBlvI3p8dgN"
}
```
:::

## Signature Generation

The request for creating payout order requires a header `signature`. This can be generated using following javascript code snippet.&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const currencyId = "currency-id";
const fiatAmount =  "0.02";
const requestId = "Order-Id-Generated-By-Application";
const clientId = "your-client-id";
const accessToken = "dynamic-access-token";

const getSignature = (secretKey, currencyId, fiatAmount, requestId) => {
    // Prepare the string to sign in same format. 
    // currencyId followed by fiatAmount followed by requestId
    const stringToSign = 'currencyId=' + currencyId + '&fiatAmount=' + fiatAmount + '&requestId=' + requestId;
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, currencyId, fiatAmount, requestId);

```

***


[title] Event Listeners
[path] Pay3 Javascript SDK/

### Introduction

After completing transactions in Pay3 SDK UI, the Pay3 SDK publishes events to App.&#x20;

### pay3-sdk-transaction-status

This event is fired by Pay3 SDK in following scenario:&#x20;

1. On completion of Checkout transaction triggered by `pay3.openCheckout()`

**Payload**

`data` (Type Object): Following keys are present in this object&#x20;

1. `status` (Type string): The status can have one of these values - SUCCESS or ERROR or INITIATED.
2. `message` (Type string): User-friendly message returned after completion of the transaction.
3. `orderId` (Type string): Pay3 Order ID. &#x20;
4. `requestId` (Type string): Unique id passed by App.

### Register callback: pay3Pay.on()

This function registers a callback, which is invoked when the given event type is received from Pay3.

**Parameter**

1. `eventName` (Type string):  Name of the event for which we want to register the callback
2. `callbackFn` (Type function):  Callback function accepting a parameter payload.&#x20;

:::CodeblockTabs
index.js

```javascript
function myListener(payload) => {
  if (payload.error) {
    console.log("Error during transaction ", payload);  
  } else {
    const { status, message, orderId, requestId } = payload.data;
    console.log("Received transaction response", { status, message, orderId, requestId });
  }
}

pay3Pay.on('pay3-sdk-transaction-status', myListener);
```
:::

### Check if registered:  pay3Pay.hasListeners()

This function returns true if the event already has a registered callback.&#x20;

**Parameter**

1. `eventName` (Type string): Name of the event for which we want to test if the callback is registered.

**Return** (Type boolean)&#x20;

```javascript
const isRegistered = pay3Pay.hasListeners('pay3-sdk-transaction-status');
```

### Unregister callback:  pay3Pay.removeListener()

This function removes a function that is already registered as a callback. Input of this function needs to be the same as that was provided in **pay3Pay.on** function call.

**Parameter**

1. `eventName` (Type string):  Name of the event for which we want to register the callback
2. `callbackFn` (Type function):  Callback function accepting a parameter payload.&#x20;

```javascript
pay3Pay.removeListener('pay3-sdk-transaction-status', myListener);
```

### Register callback in React Native using WebView

For React native with Javascript SDK, the Pay3 Payment publishes the events using `window.ReactNativeWebView.postMessage(string payload)`. These events are available via `onMessage` handler of the `WebView`

```javascript
<WebView
  source={{uri: <URL returned by openCheckout or openPayout>}}
  ...
  onMessage={(event) => {
    const data = JSON.parse(event.nativeEvent.data);
    alert(JSON.stringify(data));
  }}
/>
```

```json
// Sample JSON object
{
    "type": "pay3-sdk-transaction",
    "data": {
        "message": "Transaction completed successfully",
        "requestId": "cebb18de-739d-432d-89ff-b0dc2677c891",
        "status": "SUCCESS",
        "orderId": "1f16294b-fa2b-4eec-b55d-7c6638eb76ed"
    }
}
```

***


[title] Transactions
[path] Pay3 Javascript SDK/

### pay3Pay.openCheckout(checkoutObj)

The application can use `openCheckout` to use Pay3's Fiat only solution. Here the Pay3 modal will guide user through fiat payment services and deposit the payment to the app's Fiat account. &#x20;

**Parameters**

1. **requestId&#x20;**(Type string): App needs to generate a unique identifier for every checkout call. This id will be provided in the Javascript events and Webhooks callbacks. This id can be used by the App to identify and update state in App's backend. &#x20;
2. **user&#x20;**(Type Object): User details can be passed to Pay3 in this object.&#x20;
   1. **email** (Type string): Provide valid email address of user. This data will be passed to paymen partner during the Fiat checkout flow. Payment Partner might send mails to user updating them status of their transaction.
   2. **id** (Optional Type UUID): It will used as unique identifier of the user. If this is not present, email will be used as a unique identifier of the user within Pay3.
   3. **firstName** (Optional Type string): First name of the user with maximum length of 50 characters.
   4. **lastName** (Optional Type string): Last name of the user with maximum length of 50 characters.
   5. **taxId** (Optional Type string): This is country specific tax identifier of the user. For example for users of Brazil, it is the CPF number.
   6. **phoneNumber** (Optional Type string): This is the phone number of the user in E.164 format \[+]\[country code]\[number including area code] which can have a maximum of fifteen digits.
   7. **pixKey** (Optional Type string): This is the unique identifier for a user in the PIX system, provided by the user. It can be an email address, phone number, CPF, or a random key.
   8. &#x20;**intlBankAccount&#x20;**(Optional Type string): This is the International Bank Account Number (IBAN) entered by the user. It follows the standard IBAN format, which includes the country code, check digits, and the bank account number.
   9. **bankAccount** (Optional Type string): This is the bank account number entered by the user. It is specific to the user's bank and is used to identify the user's account within the financial institution.
   10. **docType** (Optional Type string): This specifies the type of document, which for instance for Brazil is CPF (Cadastro de Pessoas Físicas). CPF is the Brazilian individual taxpayer registry identification.
   11. **docId** (Optional Type string): This is the Documentation ID, entered by the user. It corresponds to the specific identifier for the type of document (e.g., CPF number) provided.
3. **payment** (Type Array of Objects ): This section provides is the amount payable by the user of your platform. It could be cost price of your digital asset user wishes to checkout.&#x20;
   1. **amount** (Type string): String representing currency amount in two decimal precision. The amount is provided separately for each supported currency.
   2. **name** (Type string): Name of the currency supported in the purchase flow. The name will be provided by Pay3 during Onboarding.  &#x20;
   3. **paymentMethodKey** (Optional Type string): Payment method key indicates the payment method that is suitable for the payment currency specified in **name**. This could help in customization of the user interface.  This is considered only if the **payment** array has a single\* \*Object.
4. **userMessage** (Type string): Short meaningful name of the asset user is about to purchase.&#x20;
5. **mode** (Optional Type enum string): Application can take full control on how the Pay3 payment model showed up using this option &#x20;
   1. `returnUrl` - In this mode, the openCheckout() will return a Pay3 payment url which can be used to embed within clients application. This is useful when the client need to open Pay3 url with in a WebView (in React Native application) or Iframe.
   2. `redirect` - In this mode the open checkout() function will redirect user from application's page to Pay3 payment page where user can complete the payment.&#x20;
   3. `default` - If this parameter is not sent or does not match above values, Pay3 sdk will open a new window/tab while application page will be accessible to the user in the background.
6. **callbackUrl** (Optional Type url): Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter `data` query parameter will be added to the url. Refer [callback url](docId\:dtA9vnsLmbs8xH71P53ux) for more details.

```javascript
const checkoutObj = {
  "requestId": requestId,
  "user": {
    "email": "user@email.address",
    "firstName": "John",
    "lastName": "Doe",
    "taxId": "39053344705",
    "phoneNumber": "+5511123456789",
  },
  "payment": [
    {
      "amount": "20.25",
      "name": "brl_bz",
      "paymentMethodKey": "pix"
    }
  ]
};
// Opens Pay3 Checkout modal
pay3Pay.openCheckout(checkoutObj);
```

### pay3Pay.openPayout(payoutObj)

The application can use `openPayout` to use Pay3's fiat **withdraw** solution. Once this function is called, the Pay3 modal will guide the user through the withdraw of funds flow. The funds will be deposited into users' account. &#x20;

This needs to be called after calling [create payout order](docId\:cz-cuTNjfgEFE_EokAwiO)  from application's backend.&#x20;

**Parameters**

1. **requestId&#x20;**(Type string): App needs to generate a unique identifier for every payout call. This id will be provided in the Javascript events and Webhooks callbacks. This id can be used by the App to identify and update state in App's backend.&#x20;
2. **token** (Type string): This is a unique id generated by Pay3 backend on calling [create payout order](docId\:cz-cuTNjfgEFE_EokAwiO).  This is to identify the approved order created by Application's backend.
3. **mode** (Optional Type enum string): Application can take full control on how the Pay3 payment model showed up using this option &#x20;
   1. `returnUrl` - In this mode, the openCheckout() will return a Pay3 payment url which can be used to embed within clients application. This is useful when the client need to open Pay3 url with in a WebView (in React Native application) or Iframe.
   2. `redirect` - In this mode the open checkout() function will redirect user from application's page to Pay3 payment page where user can complete the payment.&#x20;
   3. `default` - If this parameter is not sent or does not match above values, Pay3 sdk will open a new window/tab while application page will be accessible to the user in the background.
4. **callbackUrl** (Optional Type url): Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter `data` query parameter will be added to the url. Refer [callback url](docId\:dtA9vnsLmbs8xH71P53ux) for more details.

```javascript
const payoutObj = {
  "requestId": requestId,
  "token": pay3CreatedTokenId
};
// Opens Pay3 Payout modal
pay3Pay.openPayout(payoutObj);
```

### pay3Pay.openCryptoCheckout(transactionObj)

This function opens Pay3 buy crypto modal. The Buy modal will guide the user through the digital asset purchase flow using user's own digital assets like Coins and ERC20 tokens.&#x20;

User can connect their wallet and pay through the connected wallet or users can deposit using QR code. For detailed understanding please refer to [end user flow - crypto payin](docId:_DjTmc3OvtqZxoL7rytnt)

This needs to be called after calling [create crypto checkout order](docId\:twxeK26s1FEfj4VBXDnO7) from application's backend. The digital asset purchased will be deposited into the wallet address provided in the [create crypto checkout order](docId\:twxeK26s1FEfj4VBXDnO7).

**Parameters**

1. **requestId&#x20;**(Type string): App needs to generate a unique identifier for every openCryptoCheckout call. This id will be provided in the Javascript events and Webhooks callbacks. This id can be used by the App to identify and update state in App's backend.&#x20;
2. **token** (Type string): This is a unique id generated by Pay3 backend on calling create crypto checkout order. This is to identify the request created by Application's backend.
3. **mode** (Optional Type enum string): Application can take full control on how the Pay3 payment model showed up using this option &#x20;
   1. `returnUrl` - In this mode, the openCryptoCheckout() will return a Pay3 payment url which can be used to embed within clients application. This is useful when the client need to open Pay3 url with in a WebView (in React Native application) or Iframe.
   2. `redirect` - In this mode the openCryptoCheckout() function will redirect user from application's page to Pay3 payment page where user can complete the payment.&#x20;
   3. `default` - If this parameter is not sent or does not match above values, Pay3 sdk will open a new window/tab while application page will be accessible to the user in the background.
4. **callbackUrl** (Optional Type url): Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter `data` query parameter will be added to the url. Refer [callback url](docId\:dtA9vnsLmbs8xH71P53ux) for more details.

**Token buy flow where destination address is Game's wallet address&#x20;**

:::CodeblockTabs
index.js

```javascript
const transactionObj = {
  "requestId": requestId,
  "token": pay3CreatedTokenId
};

// Opens Pay3 Crypto Checkout Modal
await pay3.openCryptoCheckout(transactionObj);
```
:::

***


[title] Transactions
[path] Pay3 Android SDK/

## Pay3.getInstance().openCheckout(checkout obj)

Pay3 Android SDK expects you to pass token and requestId which you get in response while creating a checkout order with Pay3's create checkout order API

**Parameters**

1. **requestId&#x20;**(Type string): App needs to generate a unique identifier for every checkout call. This id can be used by the App to identify and update state in App's backend. &#x20;
2. **token&#x20;**(Type string):  This is a unique id generated by Pay3 backend on calling create checkout order. This is to identify the request created by Application's backend.

```kotlin
createOrder { response, error ->
    if (response != null) {
        val token = response.token
        val requestId = response.requestId
        
        Pay3.getInstance().openCheckout(
            context = this,
            requestId = requestId,
            token = token,
            onClosed = {
                // Handle payment completion or cancellation
                Log.d("Payment", "Payment flow closed")
            }
        )
    } else {
        // Handle error
        Log.e("Payment", "Failed to create order: $error")
    }
}
```

## Payment Flow

The SDK handles the complete payment flow, including:

1. Displaying available payment methods
2. UPI app selection and deep linking
3. Card and net banking options
4. Payment status tracking
5. Success/failure handling

### Example Implementatation:

:::CodeblockTabs
PaymentActivity.kt

```kotlin
import com.pay3.sdk.Pay3

class PaymentActivity : ComponentActivity() {
    private val TAG = "PaymentActivity"
    
    fun processPayment(productId: String, amount: Double) {
    // Create order with your backend with Pay3's creat checkout order API
        val orderRequest = OrderRequest(productId, amount)
        
        createOrder(orderRequest) { response, error ->
            if (response != null) {
                // Start payment flow
                Pay3.getInstance().openCheckout( // call to Pay3 Android SDK
                    context = this,
                    requestId = response.requestId,
                    token = response.token,
                    onClosed = {
                        // Payment completed or cancelled
                        // Verify payment status with your backend
                        verifyPaymentStatus(response.requestId)
                    }   
                )
            } else {
                Log.e(TAG, "Failed to create order: $error")
                showError("Unable to process payment. Please try again.")
            }
        }
    }
    
    private fun verifyPaymentStatus(requestId: String) {
        // Check payment status with your backend
    }
}
```
:::

***


[title] End User Flow - Multi Option Crypto Checkout
[path] Untitled/

This feature allows you to accept payments in cryptocurrencies and stablecoins across popular chains such as Ethereum, Tron, Solana, Polygon, and Bitcoin.

The **Multi Option Crypto Checkout** enhances the flexibility and usability of the existing crypto checkout flow by allowing users to choose their preferred cryptocurrency and network before proceeding with the payment.

User can complete the payment using two methods:

1. Connect their wallet (such as Metamask, Coinbase, WalletConnect, etc.) and pay directly through the connected wallet.&#x20;
2. Pay by scanning the QR code displayed on the screen.&#x20;

For reference, We will go over the flow of USDC Checkout on Ethereum using QR Code method.

1. User selects currency and network

When the user initiates the transaction, the user is presented with a **multi-option selection screen** that displays:

- Default token and network (for example, USDC on Ethereum)&#x20;
- A dropdown menu to select another token or network of their choice&#x20;

Once the user selects a different token or network, the **amount and fees are automatically recalculated** in real time.

This screen also supports **white-labelling**, allowing merchants to customize it with their brand colors, logo, and style for a seamless checkout experience.

::Image[]{src="https://app.archbee.com/api/optimize/9JcgbaqQe2mz216pCFoHU/YDik_bUblStif8q_cbYTu-20251017-062113.png" size="50" width="884" height="1210" position="center" showCaption="false"}

2. User proceeds to payment

After the selection is made, the user is taken to the payment screen which displays:

- The amount due&#x20;
- The selected network&#x20;
- QR code for the payment&#x20;
- Applicable transaction fees&#x20;

::Image[]{src="https://app.archbee.com/api/optimize/9JcgbaqQe2mz216pCFoHU/BN0ChxjsFPEkKw5oyTCo1-20251010-061755.png" size="50" width="960" height="1768" position="center" darkWidth="960" darkHeight="1768" showCaption="false"}

At this point, the **API initiates a payment session lasting 30 seconds**. Once 30 seconds have passed, a **20 minute countdown timer** appears on the screen for completing the payment. Both the initiation time and timer duration are **customizable based on merchant requirements**.

3\. User makes the payment

There are **three possible scenarios** for how the payment can be completed:

a. Complete payment (Exact amount)

Upon confirmation, the transaction is processed, and the **status along with the transaction reference ID** is displayed on the screen. Merchants receive the **order status update via webhook**, ensuring seamless backend synchronization and settlement.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-NrnErMLIQCF5aMRsMCXdw-20250829-052019.png" size="50" width="840" height="854" position="center" darkWidth="840" darkHeight="854" showCaption="false"}

b. Partial payment (Underpayment)

If the user makes a **partial payment**, an error screen appears informing the user that transaction is incomplete and that **additional funds must be transferred** to complete the transaction. The user can **regenerate QR code&#x20;**&#x61;nd this process can repeat until the full payment amount is received.

::Image[]{src="https://app.archbee.com/api/optimize/9JcgbaqQe2mz216pCFoHU/ZNOviQe5qVSGaHlE-VL2s-20251010-061852.png" size="50" width="682" height="810" position="center" darkWidth="682" darkHeight="810" showCaption="false"}

c. Overpayment

If the user sends **more than the due amount**, the system automatically recognizes the overpayment.

The user is shown a message that the **extra amount will be refunded** after transaction confirmation, along with the transaction reference ID and estimated refund timeline.

**Note:  BTC transactions involve longer confirmation times&#x20;**&#x63;ompared to other crypto payments. Because of Bitcoin’s inherent blockchain characteristics, users should expect delays before the payment is fully confirmed by the network. This longer processing time is normal and simply reflects the required number of blockchain confirmations.&#x20;

Hence, we take the user through a slightly different flow where a ‘Payment Initiated’ screen is shown, and the merchant is updated regarding the order status through a Webhook after we receive confirmation from the Bitcoin Network.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/5goxYzXl7cEfaX56A_Ptv-I7Uqc2lNMCT1X0PjCIyEC-20250828-085628.png" size="50" width="1260" height="1281" position="center" darkWidth="1260" darkHeight="1281" showCaption="false"}

***









[title] Pay3 API Documentation
[path] /

## Endpoints

For API endpoints please reach out to our support [.](mailto\:help@pay3.money)

![Backend Integration](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/JaLLzH4R930TIMcqzCaQI_screenshot-2024-02-08-at-42354-pm.png "Backend Integration")

## Post man Collection

[Postman API Collection](docId\:kfnfp1tLKu3mULtPwhclh)&#x20;

## Supported APIs&#x20;

&#x20;[Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA)&#x20;

[Payment Methods](docId\:HRe7PeXu-qryNwhKeuUQ0)&#x20;

[Create Fiat Checkout Order](docId\:twxeK26s1FEfj4VBXDnO7)&#x20;

[Create Fiat Payout Order](docId\:cz-cuTNjfgEFE_EokAwiO)&#x20;

[Create Crypto Payout Order](docId:_Ma9YwvAYBFe7QKrHQhWG)&#x20;

[Get Fiat Order Details](docId\:EvzG5iQKqdzSR1_pKKNDs)&#x20;

[Get Fiat Order List](docId\:PYJP721e5Bd6N-NzrIwti)&#x20;

[Get Crypto Order Details](docId\:NzZQBlpdfmg7MFy3OtpVs)&#x20;

[Create Refund](docId\:tl8Nmgc_n08DcZYsgdTZV)&#x20;

[Get Refund Details](docId:4w1_HvLWI8td_63oDU75_)&#x20;

[Get Balance](docId\:Rk45aHc33ZVX4lcRLBnbH)&#x20;

[Get Webhook](docId\:BuQOThwfa18h4xd8-mnrg)&#x20;

[Simulate Webhooks](docId\:UM7pDRzEzD83fAnQzyN7J)&#x20;

[Update Your Webhook](docId\:wNyWBebM27D4qi2vbnEEJ)&#x20;

***


[title] Pay3-EasySign
[path] /

### Why should I use Pay3-EasySign?

You want to offer a variety of signup options across Web2 and Web3 to your users which requires you to evaluate a number of services and integrate, test and maintain them. With Pay3-EasySign SDK, you can offer a variety of signup options to your users - email, mobile, social media and a host of Web3 wallets with just one integration. You can also create a wallet for your users who do not have a wallet so it is easier for them to buy your tokens, NFTs or other in-game items. The integration is extremely simple and quick enabling you to build a top notch experience for your users.

**Pay3 Wallet's integrated login flow**

![User login flow in Pay3 Wallet](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/FRRk9GvSBja0dKOa67swd_login-flow.png "Web2 & Web3 Combined User Login flow")

### What are the different methods for user sign-ins?

Pay3 supports the following methods for user sign-in methods:

1. Email Address: Users can enter the email address of their choice. We will verify by sending a One-Time password to the email address.
2. Mobile Number: We will verify by sending a One-Time password to the mobile number.
3. Social Media Accounts: We support Google, Twitter, Discord, Twitch and a host of other providers. We will verify the credentials with the respective service.
4. Web3 Wallets: We support Metamask, Coinbase, Ledger, Rainbow Wallet, Trust Wallet, and 250+ popular web3-compatible wallets.

### How do I offer a game compatible wallet to my users?

With Pay3-EasySign, your users get a wallet automatically when they signup using email address, mobile number or various social media accounts.

Pay3-EasySign also offers the ability to integrate with a wallet of your choice and we can understand your requirements during the integration process

### How does a Pay3 generated wallet work?&#x20;

With Pay3-EasySign, your users get a wallet automatically when they sign up using an email address, mobile number or various social media accounts.

We provide 2 type of wallets:

**EOA Wallet**: Our EOA (Externally Owned Account) Wallet is tailored for web3 gaming, ensuring secure and user-controlled transactions, giving gamers full autonomy over their in-game assets and interactions.

**Smart Wallet**: In addition to our EOA wallet features, our Smart Wallet integrates seamlessly with gaming platforms, offering:

1. Automated, intelligent contract interactions like batch transactions, which enhance the gaming experience.
2. Sponsored Gas Fee and/or the ability pay gas fee in any supported ERC-20 token.
3. Cross-game compatibility: for transferring their digital assets between different games without paying additional fees.

Pay3-EasySign also offers the ability to integrate with a wallet of your choice and we can understand your requirements during the integration process.

### Which blockchains do we support?

We support the following popular blockchains:

1. Ethereum
2. Polygon
3. BNB Chain
4. Avalanche
5. Arbitrum
6. Optimism
7. Cronos
8. Harmony
9. Celo
10. Moonbeam
11. Moonriver
12. Klaytn

and others.

Our platform is designed to seamlessly support 30+ blockchain networks, providing flexibility and compatibility for a wide range of decentralized applications and use cases.

We are happy to work with you to understand your requirements for Non-EVM chains and find the best solution for your needs.

### How will a user be able to view and access the digital goods in their wallet? 

Pay3 provides a portfolio page as part of the solution where users can view and access their digital assets. We can work with you to customize the portfolio page to suit your digital assets offering.&#x20;

### What countries do you support?

We are committed to providing our services to users around the world. However, due to legal and regulatory requirements, we will not be able to support any individuals or countries sanctioned by the regulations of the jurisdiction where we operate. These lists are updated from time to time and are available as part of our Terms of Service.

### How will I get reports around Sign-ups and Analytics?&#x20;

Our comprehensive client dashboard provides insightful Signup Activity Reports which offers key metrics such as:

1\. New User Onboarded per day by Signup Option
2\. New Users Onboarded in the last month by Signup Option
3\. Monthly Active Users

### How does Pay3-EasySign ensure security?

We at Pay3-EasySign encrypt sensitive data at rest and in transit using strong encryption algorithms to prevent unauthorised access. We also implement firewalls, intrusion detection prevention systems and other security measures to protect the company's network and data from cyber-attacks.&#x20;

Additionally, we regularly scan the system for vulnerabilities and fix them promptly to prevent potential attacks.

### What are Pay3’s risk and fraud protection procedures?

Pay3-EasySign incorporates risk and fraud protection measures including duplicate account creation and unauthorised access of an account.&#x20;

### How will we get support from Pay3?&#x20;

We will have dedicated representatives to support you during integration and launch. Our customer support team will be available 24\*7 at [help@pay3.money]()  or [](https://t.me/pay3_money) to answer any queries you may have once the service goes live. We will respond to all your queries within 24 hours.

We will also work with you to design your User FAQ for the Signup sections of your offering.

***


[title] Crypto Checkout Quick Start
[path] Getting Started/

This document provides a quick overview of how to create a crypto checkout order and receive payments from users.

## **Crypto Checkout Order**

This API creates a payin order and returns a website url. The website returned can be loaded in a browser. This provides users with a dynamicly generated QR code which users can use to deposit digital assets. Once the user has done the payment, the webpage shows success screen and redirects the user to the callbackUrl.&#x20;

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 and payment details.

## **Steps**

### **Step 1:&#x20;**&#x47;et Access Token&#x20;

To generate the Access Token, you will call the API with the api-secret and client-id.
Please refer to the [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA).&#x20;

### **Step 2:&#x20;**&#x43;reate 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](docId\:f18XzeE2FZKCRR_GHBdWZ).

### **Step 3:** Call [Create Crypto Checkout Order](docId\:f18XzeE2FZKCRR_GHBdWZ) API.

Sample Payload

```javascript
const payloadCryptoCheckout = {
 "requestId": "usdt-1234-poly", // TODO: Application’s Order Id, send unique id for every order (preferably UUID)
 "address": "0x.....", // TODO: add your address to receive the USDT
 "currency": "usdt_ethereum", // Please reach out to Pay3 team for enabled currencies in your clientId 
 "amount": "0.01", // Amout of USDT (in this case)
 "clientId":"....",// TODO: your clientId
 "payerEmail": "user@email.com",  //pass the email fo the user (uniqueId)
 "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

```javascript
{
   "token": "c254a82b-5ae4-44bd-b7d9-e198f8cd5f10", // Dynamicly generated UUID
   "requestId": "usdt-1234-poly",
   "requestInfoData": {
       "amount": "0.01",
       "address": "0x...",
       "clientId": "....",
       "signature": "....",
       "currency": "usdt_ethereum",
       "type": "CRYPTO-CHECKOUT"
   },
   "url": "https://pprod-ui.pay3.app/..."
}
```

### **Step 4:&#x20;**&#x52;edirect User to Checkout Page

Once the user clicks on Checkout, redirect the user to the "**url**" in the response above.

### **Step 5:&#x20;**&#x55;ser Makes the Crypto Payment

The user scans the QR code displayed on the checkout page and completes the payment using their preferred crypto wallet (e.g., MetaMask).

### **Step 6**: Payment Verified by Pay3

The Pay3 backend detects and verifies the on-chain 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](https://yoursite.com/successpage)".

### Step 8: Listen for Webhook Events&#x20;

Pay3 backend sends webhook notifications with status updates.
Upon receiving an event, you may call the [Get Crypto Order Details](docId\:NzZQBlpdfmg7MFy3OtpVs)  to retrieve the latest order details.

***


[title] Simulate Webhooks
[path] Pay3 API Documentation/

Below API can be used to simulate the webhooks which are triggered by Pay3's system. Webhooks are sent to the API endpoint shared during client onboarding in the [webhooks payload](docId:-_ZgIyFgAsxS2Uqr272QA) format.&#x20;

This API can be used for testing the back-end of client application asynchronously even when order is not being performed from UI.

The list for possible statuses can be found at [Status Reference](docId\:kw6rKJoQsYoUftKUvgyhq) .

**Note**:  This does not create any state changes or orders in Pay3's system.

:::ApiMethodV2
```json
{
  "name": "Simulate Webhook",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/simulate-webhook",
  "description": "Simulate receiving webhook data",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "9tLB3mnziDcgfDo_FqrSD",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/simulate-webhook' \\\n--header 'access-token: dynamic-access-token' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"requestId\":\"bc77de4c-9b63-4e3b-ab3e-9c509518dcf3\",\n    \"clientId\":\"320f1376-84b7-4d80-8358-bcb97c9d43a8\",\n    \"orderId\":\"10520f5d-6c20-481f-b17e-01e1ed1e75bb\",\n    \"orderStatus\":\"FAILED\",\n    \"orderType\":\"CHECKOUT\",\n    \"eventType\":\"pay3-sdk-transaction-status\",\n    \"errorCode\": \"9005\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "9tLB3mnziDcgfDo_FqrSD"
  },
  "results": {
    "languages": [
      {
        "id": "gJe7DlzGKIF9OEsGWexQF",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"message\": \"Webhook simulated successfully\"\n}"
      }
    ],
    "selectedLanguageId": "gJe7DlzGKIF9OEsGWexQF"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by Application's backend."
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "orderId",
        "kind": "required",
        "type": "string",
        "description": "This is the unique identifier in Pay3's system. This is equivalent to token shared in Create Order API's response.",
        "children": []
      },
      {
        "name": "orderStatus",
        "kind": "required",
        "type": "String",
        "description": "This is the status for which you want to simulate webhook for. You will be receiving webhook data corresponding to this status",
        "children": []
      },
      {
        "name": "orderType",
        "kind": "required",
        "type": "string",
        "description": "This represents the order type for which you want to simulate webhook. It can be CHECKOUT, PAYOUT etc.",
        "children": []
      },
      {
        "name": "eventType",
        "kind": "required",
        "type": "string",
        "description": "This respresents the event type field, which is received in webhook. It should be passed as : \n\npay3-sdk-transaction-status : for payment related webhooks\n\npay3-sdk-login-status : for easy-sign related webhooks",
        "children": []
      },
      {
        "name": "errorCode",
        "kind": "optional",
        "type": "string",
        "description": "This param accepts any one errorCode defined in SDK Errors",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "simulate-webhook",
  "legacyHash": "uiKbK5yrBUQ5jrnMcsuwb"
}
```
:::

***


[title] Create Crypto Checkout Order
[path] Pay3 API Documentation/

This API creates a payin order where user can deposit digital assets to wallet address provided by the application. It accepts `address`, `currency` and `amount`. On creating an order a dynamic `token` is returned from this api which is required to be passed [openCryptoCheckout()](docId\:Wr9g8-0vvAo95lsm3g1ye)

This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Create Crypto Order",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/crypto-checkout/create-order",
  "description": "Create an order with payin details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "nyfSHp7J-NrsuqTH3FW7t",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/crypto-checkout/create-order' \\\n--header 'signature': \"generated-signature\"\\\n--header 'access-token' : \"dynamic-access-token\" \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"requestId\":\"input-request-id\",\n    \"address\":\"input-destination-address\",\n    \"currency\":\"currency-id\",\n    \"amount\":\"input-amount-in-eth-or-btc\",\n    \"clientId\":\"your-client-id\"\n}'",
        "customLabel": "amount"
      },
      {
        "id": "wQGcNgsjTaxg3bJeZn3f2",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/crypto-checkout/create-order' \\\n--header 'signature': \"generated-signature\"\\\n--header 'access-token' : \"dynamic-access-token\" \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"requestId\":\"input-request-id\",\n    \"address\":\"input-destination-address\",\n    \"currency\":\"currency-id\",\n    \"fiatAmount\":\"10.00\",\n    \"fiatCurrency\":\"fiat-currency-id\",\n    \"clientId\":\"your-client-id\"\n}'",
        "customLabel": "fiatAmount"
      },
      {
        "id": "1UznSlcEst18mwFcilRCg",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/crypto-checkout/create-order' \\\n--header 'signature': \"generated-signature\"\\\n--header 'access-token' : \"dynamic-access-token\" \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"requestId\":\"input-request-id\",\n    \"address\":\"input-destination-address\",\n    \"currency\":\"currency-id\",\n    \"fiatAmount\":\"10.00\",\n    \"fiatCurrency\": \"usdc_ethereum\",\n    \"clientId\":\"your-client-id\",\n    \"otherChainAddresses\": {\n        \"polygon\": \"polygon-address\",\n        \"tron\": \"tron-address\"\n    }\n}'",
        "customLabel": "otherChainAddresses"
      }
    ],
    "selectedLanguageId": "1UznSlcEst18mwFcilRCg"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"token\": \"generated-token-id\",\n    \"requestId\": \"input-request-id\",\n    \"requestInfoData\": {\n        \"amount\": \"crypto-amount-in-eth\",\n        \"address\": \"input-destination-address\",\n        \"clientId\": \"your-client-id\",\n        \"signature\": \"generated-signature\",\n        \"currency\": \"currency-id\",\n        \"type\": \"CRYPTO-CHECKOUT\"\n    }\n}"
      },
      {
        "id": "tIvoQbUSKGnrqallvNDVQ",
        "language": "401",
        "customLabel": "",
        "code": "{\n    error: {\n      code: '7001',\n      message: 'Order already exists for given requestId'\n    }\n}"
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "signature",
        "kind": "required",
        "type": "string",
        "description": "Signature generated with sha256 followed by base64 encoding. Check below section for more details",
        "children": []
      },
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Identifier that is created by client application's backend. This will be passed in relevant events and webhooks from Pay3 to Application",
        "children": []
      },
      {
        "name": "address",
        "kind": "required",
        "type": "string",
        "description": "The address is your destination wallet address where funds will be sent after the transaction is confirmed.  Use a wallet that supports the selected currency and blockchain. Copy the address from your wallet’s Receive section; never type it manually to avoid irreversible errors.",
        "": "The address is your destination wallet address where funds will be sent after the transaction is confirmed.  Use a wallet that supports the selected currency and blockchain. Copy the address from your wallet’s Receive section; never type it manually to avoid irreversible errors."
      },
      {
        "name": "currency",
        "kind": "required",
        "type": "string",
        "description": "The currency is Pay3's unique string ID denoting the token that needs to be purchased. Example value are btc_bitcoin, usdt_polygon, uni_eth. "
      },
      {
        "name": "amount",
        "kind": "optional",
        "type": "string",
        "description": "The amount in ethereum / btc user needs to pay.  The API expects either this parameter or fiatAmount & fiatCurrency parameter.",
        "children": []
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      },
      {
        "name": "fiatAmount",
        "kind": "optional",
        "type": "string",
        "description": "Amount in Fiat say USD (eg: 10.50). This parameter is required when amount is not passed. Example values for ten dollar fifty cents is 10.50.",
        "children": []
      },
      {
        "name": "fiatCurrency",
        "kind": "optional",
        "type": "string",
        "description": "Fiat currency code is Pay3's unique string ID denoting the fiat currency. This parameter is required along with fiatAmount when amount is not passed. Pay3 uses current exchange rate to translate fiatAmount to amount.\nSupported fiat currencies are usd_usa, gbp_gb and eur_eu.",
        "children": []
      },
      {
        "name": "mode",
        "kind": "optional",
        "type": "string",
        "description": "When the mode is set to returnUrl, the API response includes an additional field url, which provides a direct checkout page link for accepting crypto payments. The supported values for mode are returnUrl and default.\n",
        "": "When the mode is set to returnUrl, the API response includes an additional field url, which provides a direct checkout page link for accepting crypto payments. The supported values for mode are returnUrl and default.\n"
      },
      {
        "name": "callbackUrl",
        "kind": "optional",
        "type": "string",
        "description": "Application can provide a url in this parameter. After completion of the transaction, user will be redirected to this url. An additional parameter data query parameter will be added to the url. ",
        "": "callbackUrl"
      },
      {
        "name": "lang",
        "kind": "optional",
        "type": "string",
        "description": "This parameter specifies the language preference for the Pay3 SDK. The strings used follow two letter language code as in ISO 639-1. Example pt for Portuguese, en for English.",
        "": "lang"
      },
      {
        "name": "otherChainAddresses",
        "kind": "optional",
        "type": "object",
        "description": "The \"otherChainAddresses\" parameter defines wallet addresses for alternate blockchain networks when the user switches network in the payment widget. Do not include the address specified in the primary address parameter here.\n\nFor example, for USDC on Ethereum (currency = usdc_ethereum and address = 0x1234...), you can specify alternative addresses for Tron and Polygon networks like so:\n\notherChainAddresses = {\n  \"tron\": \"Txabc123...\",\n  \"polygon\": \"0x2345...\"\n}  \n\nWhen using this parameter, set payment by fiat with \"fiatAmount\" and \"fiatCurrency\" instead of using the \"amount\" parameter.\n\nThis automatically send payments to the correct destination wallet based on the network selected by the user.",
        "": "The \"otherChainAddresses\" parameter defines wallet addresses for alternate blockchain networks when the user switches network in the payment widget. Do not include the address specified in the primary address parameter here.\n\nFor example, for USDC on Ethereum (currency = usdc_ethereum and address = 0x1234...), you can specify alternative addresses for Tron and Polygon networks like so:\n\notherChainAddresses = {\n  \"tron\": \"Txabc123...\",\n  \"polygon\": \"0x2345...\"\n}  \n\nWhen using this parameter, set payment by fiat with \"fiatAmount\" and \"fiatCurrency\" instead of using the \"amount\" parameter.\n\nThis automatically send payments to the correct destination wallet based on the network selected by the user.",
        "children": [],
        "schema": []
      },
      {
        "name": "payerEmail",
        "kind": "optional",
        "type": "string",
        "description": "Pass the email for the user (uniqueId) to identify and map the orders against the user.\n\nIf both \"userId\" and \"payerEmail\" are provided in the request, userId takes precedence and is used as the primary identifier.",
        "": "Pass the email for the user (uniqueId) to identify and map the orders against the user.\n\nIf both \"userId\" and \"payerEmail\" are provided in the request, userId takes precedence and is used as the primary identifier."
      },
      {
        "name": "userId",
        "kind": "optional",
        "type": "string",
        "description": "Pass any string for the user (uniqueId) to identify and map the orders against the user. This can be same value which you are using in your application to uniquely identify the users.\n\nIf both \"userId\" and \"payerEmail\" are provided in the request, userId takes precedence and is used as the primary identifier.",
        "": "Pass any string for the user (uniqueId) to identify and map the orders against the user. This can be same value which you are using in your application to uniquely identify the users.\n\nIf both \"userId\" and \"payerEmail\" are provided in the request, userId takes precedence and is used as the primary identifier."
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "create-crypto-order",
  "legacyHash": "sqj7sRsDC04r4g-8bBx8B"
}
```
:::

## Signature Generation

The request for creating payout order requires a header `signature`. This can be generated using following javascript code snippet.&#x20;

### Case 1: With amount parameter&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const address = "destination-wallet-address";
const currency = "currency-id";
const amount =  "0.02";
const requestId = "Order-Id-Generated-By-Application";

const getSignature = (secretKey, address, currency, amount, requestId) => {
    // Prepare the string to sign in same format. 
    const stringToSign = 'address=' + address + '&currency=' + currency + '&amount=' + amount + '&requestId=' + requestId;
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, address, currency, amount, requestId);

```

### Case 2: With fiatAmount & fiatCurrency parameter&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const address = "destination-wallet-address";
const currency = "currency-id";
const fiatAmount =  "10.50"; // $10.50
const fiatCurrency =  "usd_usa"; // Example for USD
const requestId = "Order-Id-Generated-By-Application";

const getSignature = (secretKey, address, currency, fiatAmount, fiatCurrency, requestId) => {
    // Prepare the string to sign in same format. 
    const stringToSign = 'address=' + address + '&currency=' + currency + '&fiatAmount=' + fiatAmount + '&fiatCurrency=' + fiatCurrency + '&requestId=' + requestId;
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, address, currency, fiatAmount, fiatCurrency, requestId);

```

### Case 3: With otherChainAddresses parameters

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey = "Api-Secret-Provided-By-Pay3";
const address = "destination-wallet-address";
const currency = "currency-id";
const fiatAmount = "10.50"; // $10.50
const fiatCurrency = "usd_usa"; // Example for USD
const requestId = "Order-Id-Generated-By-Application";

const otherChainAddresses = {
    "ethereum": "0x...",
    "solana": "...",
    "devnet": "...",
    "amoy": "..."
};

const getSignature = (secretKey, address, currency, amount, fiatAmount, fiatCurrency, requestId, otherChainAddresses = {}) => {
    // Build otherChainAddresses parameter string
    let otherChainAddressesParam = "";
    if (Object.keys(otherChainAddresses).length > 0) {
        // Sort alphabetically by key
        const sortedEntries = Object.entries(otherChainAddresses).sort(([a], [b]) => a.localeCompare(b));
        otherChainAddressesParam = sortedEntries.map(([key, value]) => `&${key}=${value}`).join('');
    }
    let stringToSign = 'address=' + address + '&currency=' + currency + '&fiatAmount=' + fiatAmount + '&fiatCurrency=' + fiatCurrency + '&requestId=' + requestId + otherChainAddressesParam;    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
};

// Generate Signature
const signature = getSignature(secretKey, address, currency, amount, fiatAmount, fiatCurrency, requestId, otherChainAddresses);
```

***


[title] Pay3 Android SDK
[path] /

Pay3 Android SDK is distributed via a Maven repository and can be integrated into Android applications. This SDK provides support for Pay3 payment services on Android platforms.

![Pay3 Checkout Flow](https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/EcRL5_SIniwuOBZdZJKiy_pay3-sdk-checkout-integration-4.png "Pay3 Checkout Flow")

Above image illustrates the data flow between the application and Pay3 platform.


[title] Callback URL
[path] Pay3 Javascript SDK/

### Introduction

The application can call transaction functions using an optional parameter called `callbackUrl`. Once this parameter is set Pay3 payment modal will **redirect** the user to this URL with in couple of seconds after transaction is complete. Pay3 payment modal also added an additional parameter `data` as a query parameter so that your user can be shown the transaction result within this page.&#x20;

This works well with the `mode=redirect` or `mode=returnUrl` where Pay3 will not be able to send Javascript events to the starting page.&#x20;

**Example**

```javascript
const checkoutObj = {
  "requestId": requestId,
  "user": {
    "email": "user@email.address"
  },
  "payment": [
    {
      "amount": "20.25",
      "name": "brl_bz",
    }
  ],
  "mode": "redirect",
  "callbackUrl": "https://your-whitelisted-url.com/xyz"
};
pay3Pay.openCheckout(checkoutObj);
```

### Payment Results

Payment results are added to the `callbackUrl` using a parameter `data`. The value of the parameter is a base64 encoded, JSON string of the result.&#x20;

**Sample code to decode the data payload**

```javascript
// After completing transaction, Pay3 payment modal will redirect
// to callbackUrl - For example
// https://your-whitelisted-url.com/xyz?data=eyJkYXRhIjp7InN0YXR1cyI6IlNVQ0NFU1MiLCJtZXNzYWdlIjoiVHJhbnNhY3Rpb24gY29tcGxldGVkIHN1Y2Nlc3NmdWxseSIsIm9yZGVySWQiOiIwOWQ4Mzc1Zi04MDUxLTQyNTctYWI0NC1hNTY1OGIzNTBiZDMiLCJyZXF1ZXN0SWQiOjQ2ODg3NywicmVjZWlwdCI6InR4blJlY2VpcHQifX0= 

data='eyJkYXRhIjp7InN0YXR1cyI6IlNVQ0NFU1MiLCJtZXNzYWdlIjoiVHJhbnNhY3Rpb24gY29tcGxldGVkIHN1Y2Nlc3NmdWxseSIsIm9yZGVySWQiOiIwOWQ4Mzc1Zi04MDUxLTQyNTctYWI0NC1hNTY1OGIzNTBiZDMiLCJyZXF1ZXN0SWQiOjQ2ODg3NywicmVjZWlwdCI6InR4blJlY2VpcHQifX0=';
resultObj = JSON.parse(atob(data));

/*
{
    "data": {
        "status": "SUCCESS",
        "message": "Transaction completed successfully",
        "orderId": "09d8375f-8051-4257-ab44-a5658b350bd3",
        "requestId": 468877,
        "receipt": "txnReceipt"
    }
}
*/
```

**Payload**

1. `data` (Type Object): Following keys are present in this object&#x20;
   1. `status` (Type string): The status can have one of these values - SUCCESS or ERROR or INITIATED.
   2. `message` (Type string): User-friendly message returned after completion of the transaction.
   3. `orderId` (Type string): Pay3 Order ID. &#x20;
   4. `requestId` (Type string): Unique ID passed by Application

### Whitelisting of Callback URL

The domain of the callback URL needs to be whitelisted for the clientId. Please reach out to support if you see following error. The domain needs to be whitelisted. According to the above example `https://your-whitelisted-url.com` needs to be whitelisted.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/TAFeEm-pVk18eerzEFtTV_screenshot-2024-06-26-at-40348-pm.png" size="50" width="458" height="336" position="center" caption="Domain not whitelisted error" alt="Image of domain not whitelisted error" showCaption="true"}

***


[title] Get Refund Details
[path] Pay3 API Documentation/

API that returns clients refund orders matching the *requestId*. This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

The response is a list of refund orders which matches the given criteria.

1. `status` : For list of possible refund status please refer : [Order Status](docId\:kw6rKJoQsYoUftKUvgyhq)&#x20;
2. `requestId` : Unique ID passed during Order creation
3. `fiatAmount` : Currency Amount
4. `errorReason` : Contains `errorCode` and `errorDesc`. List of possible [Error Codes](docId\:upvtC67WkwGNCSCjVAQ0v)

:::ApiMethodV2
```json
{
  "name": "Get Refund Details",
  "method": "GET",
  "url": "https://your-hostname.pay3.app/v1/client/fiat-refunds?requestId=your-request-id&clientId=your-client-id",
  "description": "Get order details by client's request-id",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "3LjxGJCqZzKeICMDOi23s",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/fiat-refunds?requestId=your-request-id&clientId=your-client-id' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'access-token: ACCESS-TOKEN-IN-JWT'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "3LjxGJCqZzKeICMDOi23s"
  },
  "results": {
    "languages": [
      {
        "id": "GC_lbEEV7Jo_hgFNI1cHK",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"data\": \n      [  {\n             \"requestId\": \"9824649238\",\n             \"refundId\": \"a35dc551-9fb4-491c-9f9b-44d9c2ef4b32\",\n             \"fiatAmount\": \"0.02\",\n             \"status\": \"REFUND_INITIATED\"\n        }],\n    \"errorReason\": {\n                \"errorCode\": \"9006.1\",\n                \"errorDesc\": \"There was an issue with Refund transaction.\"\n            }\n}"
      },
      {
        "id": "Ybev9LI4TwGz-n2zW-919",
        "language": "401",
        "customLabel": "",
        "code": "{\"error\":\"Client verification failed\"}"
      }
    ],
    "selectedLanguageId": "GC_lbEEV7Jo_hgFNI1cHK"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "Request Id is the unique id that was passed by your application while creating the order.",
        "children": []
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client Id",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired.",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "autoGeneratedAnchorSlug": "get-refund-details",
  "legacyHash": "fu3YU22x9_FsJegI3d7-x"
}
```
:::

***


[title] End User Flow - Subscriptions
[path] Untitled/

This feature allows users to subscribe to products or services and make recurring payments seamlessly through the Pay3 platform.

The **Subscriptions Flow** enables users to complete an initial payment and automatically renew their subscription at regular intervals - daily, weekly, monthly, or yearly using payment options such as cards, bank transfer, or local wallets.&#x20;

**1. User lands on Subscription Checkout Page**
The user is directed to the subscription checkout page displaying plan details, amount, and available local payment options.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/CLTdGD15z73z6CNzVZn9i-20260107-103345.png" size="50" width="930" height="1498" position="center" showCaption="false"}

**2. User makes the payment**
The user selects a preferred payment method and completes the initial payment. Once successful, the subscription is activated.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/9JcgbaqQe2mz216pCFoHU/FJ0h90WEY7KxYTnn51iyk-20260107-103419.png" size="50" width="930" height="1632" position="center" showCaption="false"}

::Image[]{src="https://app.archbee.com/api/optimize/5goxYzXl7cEfaX56A_Ptv-NrnErMLIQCF5aMRsMCXdw-20250829-052019.png" size="50" width="840" height="854" position="center" showCaption="false"}

**3. Recurring payments are set**
Subsequent payments are automatically charged based on the billing cycle, ensuring continuous service access.

***




[title] Create Refund
[path] Pay3 API Documentation/

This API creates a refund order to enable merchants to refund a successfully processed transaction. It accepts amount and the order details.  &#x20;

This api requires access token that can be generated using [Access Token](docId\:lq-v6fF_2i-h1O3XD5KKA) API.

:::ApiMethodV2
```json
{
  "name": "Create Refund ",
  "method": "POST",
  "url": "https://your-hostname.pay3.app/v1/client/fiat-refund",
  "description": "Create an order with payout details from application's backend",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "eXhyHL9RWXfgU_lG6oq1Q",
        "language": "curl",
        "code": "curl --location 'https://your-hostname.pay3.app/v1/client/fiat-refund' \\\n--header 'signature': \"generated-signature\"\\\n--header 'access-token' : \"dynamic-access-token\" \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"fiatAmount\": \"0.02\",\n    \"requestId\": \"9824649238\",\n    \"clientId\": \"your-client-id\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "eXhyHL9RWXfgU_lG6oq1Q"
  },
  "results": {
    "languages": [
      {
        "id": "VQyRchSR38UbBEhATUpjh",
        "language": "200",
        "customLabel": "",
        "code": "{\n  \"requestId\": \"9824649238\",\n  \"refundId\": \"a35dc551-9fb4-491c-9f9b-44d9c2ef4b32\",\n  \"fiatAmount\": \"0.02\",\n  \"status\": \"REFUND_CREATED\"\n  }\n}\n"
      }
    ],
    "selectedLanguageId": "VQyRchSR38UbBEhATUpjh"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "signature",
        "kind": "required",
        "type": "string",
        "description": "Signature generated with sha256 followed by base64 encoding. Check below section for more details",
        "children": []
      },
      {
        "name": "access-token",
        "kind": "required",
        "type": "string",
        "description": "Access token received from Access token API. You can reuse the access token across multiple API calls till it is expired",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "requestId",
        "kind": "required",
        "type": "string",
        "description": "The requestId used to create the parent order. ",
        "": "The requestId used to create the parent order. "
      },
      {
        "name": "fiatAmount",
        "kind": "required",
        "type": "string",
        "description": "Amount user can be refunded in string format. This amount should be less than or equal to the parent order amount. Maximum two decimal places are allowed",
        "": "Amount user can be refunded in string format. This amount should be less than or equal to the parent order amount. Maximum two decimal places are allowed"
      },
      {
        "name": "clientId",
        "kind": "required",
        "type": "string",
        "description": "Client id. Application's identifier",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "create-refund",
  "legacyHash": "ndwJglHmBpAR2On-P5bTb"
}
```
:::

## Signature Generation

The request for creating payout order requires a header `signature`. This can be generated using following javascript code snippet.&#x20;

```javascript
const crypto = require('crypto');

// Required Parameters
const secretKey="Api-Secret-Provided-By-Pay3";
const fiatAmount =  "0.02";
const requestId = "Order-Id-Generated-By-Application";
const clientId = "your-client-id";
const accessToken = "dynamic-access-token";

const getSignature = (secretKey, fiatAmount, requestId) => {
    // Prepare the string to sign in same format. 
    // fiatAmount followed by requestId
    const stringToSign = 'fiatAmount=' + fiatAmount + '&requestId=' + requestId;
    
    // Generating signature using SHA256 and provided secret and
    // base64 encode the result
    const mac = crypto.createHmac('sha256', secretKey);
    return mac.update(stringToSign).digest('base64');
}

// Generate Signature
const signature = getSignature(secretKey, fiatAmount, requestId);

```

***

