# token\_transaction.php

## Verifies the details of an SPL token transaction made through SOL Pay

<mark style="color:blue;">`GET`</mark> `https://solpay.solblaze.org/transaction.php`

The transaction endpoint takes in three parameters: `to`, `txid`, and `token`. The `to` parameter is for the recipient address, the `txid` is for the transaction signature (which can be obtained through one of the following transaction functions: [send-tokens-decimal](https://solpay-docs.solblaze.org/reference/sdk-reference/send-tokens-decimal "mention"), [send-tokens](https://solpay-docs.solblaze.org/reference/sdk-reference/send-tokens "mention"), [sign-transaction](https://solpay-docs.solblaze.org/reference/sdk-reference/sign-transaction "mention")), and the `token` is for the token mint address. The endpoint returns the sender address and the number of tokens sent (in both decimal and integer form).

#### Query Parameters

| Name                                    | Type   | Description                                |
| --------------------------------------- | ------ | ------------------------------------------ |
| to<mark style="color:red;">\*</mark>    | string | recipient address                          |
| txid<mark style="color:red;">\*</mark>  | string | transaction signature                      |
| token<mark style="color:red;">\*</mark> | string | token address                              |
| network                                 | string | mainnet-beta (default), devnet, or testnet |

{% tabs %}
{% tab title="200: OK success - the transaction details are returned" %}

```javascript
{
    "status": "success",
    "transaction": {
        "amount": 10000,
        "amount_decimal": 1.0e-5,
        "decimals": 9,
        "from": "SENDER_ADDRESS"
    }
}
```

{% endtab %}

{% tab title="200: OK error - could not find transaction " %}

```javascript
{
    "status": "error",
    "error": "There was no transaction with the specified txid made through SOL Pay."
}
```

{% endtab %}

{% tab title="200: OK error - missing parameters" %}

```javascript
{
    "status": "error",
    "error": "Missing parameters, endpoint requires the following fields: to, txid, token."
}
```

{% endtab %}

{% tab title="200: OK error - maintenance mode" %}

```javascript
{
    "status": "error",
    "error": "SOL Pay is in maintenance mode, please try again in a few minutes."
}
```

{% endtab %}

{% tab title="200: OK error - extended maintenance mode" %}

```javascript
{
    "status": "error",
    "error": "SOL Pay is in extended maintenance mode, please try again later."
}
```

{% endtab %}

{% tab title="200: OK error - unknown" %}

```javascript
{
    "status": "error",
    "error": "An unknown error occurred, please try again in a few minutes"
}
```

{% endtab %}
{% endtabs %}

### Example Request:

```
https://solpay.solblaze.org/token_transaction.php?to=RECIPIENT_ADDRESS&txid=TRANSACTION_SIGNATURE&token=TOKEN_ADDRESS&network=mainnet-beta
```
