# Get Transaction State

After the modal is closed, you should fetch the transaction to know the current status. Make a **GET** request to the following endpoint.

{% code overflow="wrap" %}

```url
https://api.localramp.co/v1/transaction/buy/status/:reference
```

{% endcode %}

With the following header

```
x-auth-token: <SECRET_KEY>
```

If the API call is successful, LocalRamp returns the following response:

```javascript
{
    "status": "success",
    "data": {
        "reference": "my-unique-ref",
        "state": "completed",
        "txid": "<txID>",
        "received_amount": "0.7382747",
        "receiver_currency": "BTC_BTC",
        "sent_amount": "10000",
        "sender_currency": "NGN",
        "destination_address": "<address>",
        "destination_tag": null,
        "email": "test@example.com",
        "payment_method": "bank_transfer", //mobile_money
        "source_account_bank": "Wallet Bank"
        "phone_network": "MTN",
        "phone_number":"+2340000000",
    }
}
```

The possible `state`'s are <mark style="color:red;">`awaiting_payment`</mark>, <mark style="color:orange;">`pending`</mark> and <mark style="color:green;">`completed`</mark>

**awaiting\_payment** - This means we are yet to receive payment from the customer.

**pending** -  This means we have received payment and we are processing the request

**completed** - This means that the transaction has been completed

{% hint style="info" %} <mark style="color:orange;">`sent_amount`</mark> is the fiat amount sent by the user minus localramp fees.<mark style="color:orange;">`received_amount`</mark> is the amount in crypto sent to the wallet. Note that these are different from the <mark style="color:purple;">`sender_amount`</mark> and <mark style="color:purple;">`receiver_amount`</mark>used in initiating the transaction.
{% endhint %}


---

# 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.localramp.co/crypto-on-ramp/get-transaction-state.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.
