# Check Transaction Status

## Check Status API

After that user signed a transaction on his/her wallet, you should call this endpoint periodically to see what's the status of that transaction.

{% tabs %}
{% tab title="Typescript (SDK)" %}

```typescript
const response = await rango.status({
    requestId: 'b3a12c6d-86b8-4c21-97e4-809151dd4036',
    txId: '0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5',
})
```

{% endtab %}

{% tab title="Node.js (Axios)" %}

```javascript
const response = await axios.get('https://api.rango.exchange/basic/status', {
  params: {
    'requestId': 'b3a12c6d-86b8-4c21-97e4-809151dd4036',
    'txId': '0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5',
    'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
  }
});
```

{% endtab %}

{% tab title="Bash (cURL)" %}
{% code overflow="wrap" %}

```bash
curl --request GET \
     --url 'https://api.rango.exchange/basic/status?requestId=b3a12c6d-86b8-4c21-97e4-809151dd4036&txId=0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% embed url="<https://rango-api.readme.io/reference/status>" %}
Check Transaction Status Swagger
{% endembed %}

{% hint style="info" %}

* This endpoint is not suitable for checking approval transaction and it is only for the original transaction. For checking approval transaction status, please check [this section](#3.-check-approval-status).
* In on-chain transactions, you could also check transaction status by checking transaction receipt (via RPC) if you prefer. But in cross-chain swaps (e.g. bridges), you could use this method to make sure outbound transaction (transaction on destination chain) succeeds without any problem.
  {% endhint %}

### Check Transaction Status Request&#x20;

{% tabs %}
{% tab title="API Definition" %}

* **`requestId`** <mark style="color:red;">\*</mark> String
  * Description: The unique ID which is generated in the swap endpoint.
  * Example: `b3a12c6d-86b8-4c21-97e4-809151dd4036`
* **`txId`** <mark style="color:red;">\*</mark> String
  * Description: Transaction hash that wallet returned.
  * Example: `0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5`
    {% endtab %}

{% tab title="SDK Models (Typescript)" %}

```typescript
export type StatusRequest = {
  requestId: string
  txId: string
}
```

{% endtab %}
{% endtabs %}

### Check Transaction Status Response&#x20;

{% tabs %}
{% tab title="API Definition" %}

* **`status`**
  * Description: Status of the transaction, while the status is `running` (or `null`), the client should retry until it turns into `success` or `failed`.
* **`error`**
  * Description: A message in case of failure, that could be shown to the user.
* **`output`**
  * Description: The output asset and amount, could be different from the destination asset in case of failures or refunds. \
    In the context of a cross-chain swap, the process combines up to three transactions (\[dex]+bridge+\[dex]) into a single transaction. Consequently, several scenarios could arise if a user ends up receiving a token that differs from their initial expectation. These are possible cases for `output.type`:&#x20;
    * `DESIRED_OUTPUT` When your transaction status is marked as successful, it indicates that the bridge or swap process has been successfully completed, and the user has received the intended `DESIRED_OUTPUT` token as part of the output.&#x20;
    * `REVERTED_TO_INPUT` If user transaction reverted on first dex step, transaction will be reverted on the blockchain and user will receive back the input token.
    * `MIDDLE_ASSET_IN_SRC` If the dex step succeeded but the bridge step failed because of slippage or lack of liquidity or ...&#x20;
    * `MIDDLE_ASSET_IN_DEST` If the \[dex]+bridge step succeeded but, the last dex step failed because of slippage.
* **`explorerUrl`**
  * Description: List of explorer URLs for the transactions of this swap. Including inbound transaction link, outbound transaction link and etc.
* **`diagnosisUrl`**
  * Description: If a transaction becomes stuck within a bridge, requiring user intervention to initiate a refund through the bridge's user interface, we offer a diagnosis URL. This URL directs the user to a guide detailing the steps they need to take in order to successfully refund their tokens from the route underlying protocol.
  * Example: <https://rango.exchange/diagnosis/wormhole?iframe=1>
* **`bridgeData`**
  * Description: Status of bridge. At the moment, this field is only filled when we have a bridge/swap transaction between two EVM chains. (e.g. from Polygon to Avax) It contains both data of inbound and outbound transactions/tokens.
    {% endtab %}

{% tab title="SDK Models (Typescript)" %}

```typescript
export type StatusResponse = {
  status: TransactionStatus | null
  error: string | null
  output: StatusOutput | null
  explorerUrl: SwapExplorerUrl[] | null
  diagnosisUrl: string | null
  bridgeData: BridgeData | null
}

export enum TransactionStatus {
  FAILED = 'failed',
  RUNNING = 'running',
  SUCCESS = 'success',
}

export type StatusOutput = {
  amount: string
  receivedToken: Token
  type:
  | 'REVERTED_TO_INPUT'
  | 'MIDDLE_ASSET_IN_SRC'
  | 'MIDDLE_ASSET_IN_DEST'
  | 'DESIRED_OUTPUT'
}

export type Token = {
  blockchain: string
  chainId: string | null
  address: string | null
  symbol: string
  name: string | null
  decimals: number
  image: string
  blockchainImage: string
  usdPrice: number | null
  isPopular: boolean
  supportedSwappers: string[]
}

export type BridgeData = {
  srcChainId: number
  srcTxHash: string | null
  srcToken: string | null
  srcTokenAmt: string
  srcTokenDecimals: number
  srcTokenPrice: string | null
  destChainId: number
  destTxHash: string | null
  destToken: string | null
  destTokenAmt: string | null
  destTokenDecimals: number
  destTokenPrice: string | null
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": "success",
  "error": null,
  "diagnosisUrl": null,
  "explorerUrl": [
    {
      "url": "https://arbiscan.io/tx/0xf25f22c8dec8512c179c723e9d4c494ac35b991f6f4a9b0c10e63ac94d059f81",
      "description": "Inbound"
    },
    {
      "url": "https://basescan.org/tx/0x676d7120d941588340a7ef76287cc9d3ad846be0cdcc30609472a10b30c171b2",
      "description": "Outbound"
    }
  ],
  "output": {
    "amount": "50914691310462592",
    "receivedToken": {
      "blockchain": "BASE",
      "symbol": "ETH",
      "name": null,
      "isPopular": false,
      "chainId": "8453",
      "address": null,
      "decimals": 18,
      "image": "https://rango.vip/tokens/ALL/ETH.png",
      "blockchainImage": null,
      "usdPrice": null,
      "supportedSwappers": [
        
      ]
    },
    "type": "DESIRED_OUTPUT"
  },
  "bridgeData": {
    "srcChainId": 42161,
    "srcTxHash": "0xf25f22c8dec8512c179c723e9d4c494ac35b991f6f4a9b0c10e63ac94d059f81",
    "srcToken": null,
    "srcTokenAmt": "51000000000000000",
    "srcTokenDecimals": 18,
    "srcTokenPrice": "2609.9",
    "destChainId": 8453,
    "destTxHash": "0x676d7120d941588340a7ef76287cc9d3ad846be0cdcc30609472a10b30c171b2",
    "destToken": null,
    "destTokenDecimals": 18,
    "destTokenAmt": "50914691310462592",
    "destTokenPrice": "2609.9"
  }
}
```

{% 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.rango.exchange/api-integration/basic-api-single-step/api-reference/check-transaction-status.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.
