# Get Instance Information

This endpoint allows you to retrieve detailed information about a specific Pay-In transaction. The `merchantOrderId` is required, and it corresponds to the unique identifier generated by merchant at the time of creating a payment instance.

#### Endpoint

<mark style="color:green;">**`GET`**</mark>`https://api.tylt.money/p2pRampsMerchant/getInstanceDetails?merchantOrderId={merchantOrderId}`

#### Example Request

<mark style="color:green;">**`GET`**</mark>`https://api.tylt.money/p2pRampsMerchant/getInstanceDetails?merchantOrderId=dOf6cc25-e9f9-11ef-830e-02d8461243e9`

**Request Headers**

{% tabs %}
{% tab title="Headers" %}

<table data-full-width="true"><thead><tr><th width="133">Name</th><th width="79">Type</th><th width="167">Example</th><th>Description</th></tr></thead><tbody><tr><td>X-TLP-APIKEY</td><td>string</td><td>93ee3c5e133697251b5362bcf9cc8532476785t8768075616f58d88</td><td>Your Tylt API Key, used to identify your account in API requests.</td></tr><tr><td>X-TLP-SIGNATURE</td><td>string</td><td>d0afef3853dfc8489c8b9affa5825171fdd7y7685675e4966a05f66ed2b3eaf9462b3c9c0</td><td>HMAC SHA-256 signature generated using the API Secret Key to secure the request.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
When using the API, ensure to include your API Key and generate the signature for the request payload using your API Secret. The tables provided above contain example values for illustration purposes only. Please refer to the code snippets for detailed instructions on how to sign the request and generate the signature properly.
{% endhint %}

**Code Snippet**

{% tabs %}
{% tab title="Python" %}

```python
import json
import hashlib
import hmac
import requests

# Replace with your API Key and Secret
api_key = 'your-api-key'
api_secret = 'your-secret-key'

# Function to create HMAC SHA-256 signature
def create_signature(secret, data):
    return hmac.new(secret.encode(), data.encode(), hashlib.sha256).hexdigest()

# Function to send a GET request
def send_get_request(url, params):
    raw = '&'.join([f"{key}={value}" for key, value in params.items()])
    body_string = json.dumps(params, separators=(',', ':'), ensure_ascii=False)
    signature = create_signature(api_secret, body_string)

    headers = {
        'X-TLP-APIKEY': api_key,
        'X-TLP-SIGNATURE': signature
    }

    response = requests.get(f"{url}?{raw}", headers=headers)
    return response.json()

# Request parameters for GET request
get_params = {
    'instanceId': 'dOf6cc25-e9f9-11ef-830e-02d8461243e9'
}

# Send the GET request
get_response = send_get_request("https://api.tylt.money/p2pRampsMerchant/getInstanceDetails", get_params)
print(get_response)

```

{% endtab %}

{% tab title="JavaScript" %}

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

const params = {
  instanceId: 'dOf6cc25-e9f9-11ef-830e-02d8461243e9'
};

const queryString = new URLSearchParams(params).toString();
const url = `https://api.tylt.money/p2pRampsMerchant/getInstanceDetails?${queryString}`;

const apiKey = 'your-api-key';
const secretKey = 'your-secret-key';

const signaturePayload = JSON.stringify(params);
const signature = crypto.createHmac('sha256', secretKey)
  .update(signaturePayload)
  .digest('hex');

const requestOptions = {
  method: 'GET',
  headers: {
    'X-TLP-APIKEY': apiKey,
    'X-TLP-SIGNATURE': signature
  },
  redirect: 'follow'
};

fetch(url, requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.error('error', error));

```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="Response Example" %}
{% hint style="info" %}
To better understand the payment process lifecycle and effectively utilize the data provided by the **Get Instance Information** API, refer to the detailed explanation of the event lifecycle [here](/introduction/tylt-crossramp-fiat-crypto-solutions/india-inr/upi-payin-inr-usdt/web-hook-upi-pay-in.md)
{% endhint %}

```json
{
    "msg": "",
    "data": {
        "trade": {
            "isBuyTrade":1,
            "event": {
                "id": null,
                "deadline": null,
                "description": null
            },
            "createdAt": null,
            "updatedAt": null,
            "fiatCurrency": {
                "name": null,
                "symbol": null
            },
            "priceDetails": {
                "price": null,
                "amount": null,
                "paymentAmount": null
            },
            "paymentMethod": {
                "details": null
            },
            "cryptoCurrency": {
                "name": null,
                "symbol": null
            }
        },
        "transaction": {
            "amount": null,
            "status": null,
            "isFinal": null,
            "orderId": null,
            "createdAt": null,
            "isCredited": null,
            "updatedAt": null,
            "merchantOrderId": null
        },
        "user": {}
    }
}
```

{% endtab %}

{% tab title="Response Fields" %}

| Field                                 | Type    | Description                                                                                                                                                                                               |
| ------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| msg                                   | string  | Message providing additional context about the response.                                                                                                                                                  |
| data                                  | object  | Container for the response data.                                                                                                                                                                          |
| data.trade                            | object  | Details about the trade.                                                                                                                                                                                  |
| data.trade.isBuyTrade                 | number  | Indicates if the trade is a buy trade (1 for buy, 0 for sell).                                                                                                                                            |
| data.trade.event                      | object  | Contains event details related to the trade lifecycle.                                                                                                                                                    |
| data.trade.event.id                   | number  | The event ID representing the current state of the trade. Read more about widget lifecycle [here](/introduction/tylt-crossramp-fiat-crypto-solutions/india-inr/upi-payin-inr-usdt/web-hook-upi-pay-in.md) |
| data.trade.event.deadline             | string  | Deadline for completing the trade, in ISO 8601 format.                                                                                                                                                    |
| data.trade.event.description          | string  | A description of the eventId or its state.                                                                                                                                                                |
| data.trade.createdAt                  | string  | Timestamp when the trade was created, in ISO 8601 format.                                                                                                                                                 |
| data.trade.updatedAt                  | string  | Timestamp when the trade was last updated, in ISO 8601 format.                                                                                                                                            |
| data.trade.fiatCurrency               | object  | Details about the fiat currency used in the trade.                                                                                                                                                        |
| data.trade.fiatCurrency.name          | string  | Name of the fiat currency (e.g., Indian Rupee).                                                                                                                                                           |
| data.trade.fiatCurrency.symbol        | string  | Symbol of the fiat currency (e.g., INR).                                                                                                                                                                  |
| data.trade.priceDetails               | object  | Price-related details for the trade.                                                                                                                                                                      |
| data.trade.priceDetails.price         | number  | The price per unit of the cryptocurrency in fiat currency.                                                                                                                                                |
| data.trade.priceDetails.amount        | number  | The amount of cryptocurrency involved in the trade.                                                                                                                                                       |
| data.trade.priceDetails.paymentAmount | number  | Total fiat payment amount for the trade.                                                                                                                                                                  |
| data.trade.paymentMethod              | object  | Information about the payment method used.                                                                                                                                                                |
| data.trade.paymentMethod.details      | string  | Details of the payment method (e.g., UPI).                                                                                                                                                                |
| data.trade.cryptoCurrency             | object  | Details about the cryptocurrency used in the trade.                                                                                                                                                       |
| data.trade.cryptoCurrency.name        | string  | Name of the cryptocurrency (e.g., US Theather).                                                                                                                                                           |
| data.trade.cryptoCurrency.symbol      | string  | Symbol of the cryptocurrency (e.g., USDT).                                                                                                                                                                |
| data.transaction                      | object  | Details about the associated transaction.                                                                                                                                                                 |
| data.transaction.amount               | number  | The amount of fiat involved in the transaction.                                                                                                                                                           |
| data.transaction.status               | string  | Current status of the transaction (e.g., Pending, Completed).                                                                                                                                             |
| data.transaction.isFinal              | boolean | Indicates whether the transaction is in its final state.                                                                                                                                                  |
| data.transaction.orderId              | string  | Unique identifier for the transaction.                                                                                                                                                                    |
| data.transaction.createdAt            | string  | Timestamp when the transaction was created, in ISO 8601 format.                                                                                                                                           |
| data.transaction.updatedAt            | string  | Timestamp when the transaction was last updated, in ISO 8601 format.                                                                                                                                      |
| data.transaction.isCredited           | boolean | Indicates if the amount has been credited to the merchant.                                                                                                                                                |
| data.transaction.merchantOrderId      | string  | Merchant-provided unique identifier for the transaction.                                                                                                                                                  |
| data.user                             | object  | User-related information provided by the Merchant.                                                                                                                                                        |

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tylt.money/introduction/tylt-crossramp-fiat-crypto-solutions/brazil-brl/pix-payin-brl-usdt/get-instance-information.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
