> ## Documentation Index
> Fetch the complete documentation index at: https://docs.billstack.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a Transaction

> Retrieve a single transaction by its session id.

Fetch a transaction (a payment received into a virtual account) using its **session id** : the `transaction_ref` / `wiaxy_ref` that BillStack reports in the [payment webhook](/webhooks/overview).

## Endpoint

```http theme={null}
POST https://api.billstack.co/v2/thirdparty/getTransaction/
```

<ParamField header="Authorization" type="string" required>
  Your secret key as a Bearer token: `Bearer Bill_Stack-SEC-KEY-…`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Body parameters

<ParamField body="session_id" type="string" required>
  The session id of the transaction : the same value delivered as `transaction_ref` / `wiaxy_ref` in the payment webhook.
</ParamField>

## Request

```bash theme={null}
curl -X POST https://api.billstack.co/v2/thirdparty/getTransaction/ \
  -H "Authorization: Bearer Bill_Stack-SEC-KEY-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "inter_bank_reference"
  }'
```

## Response

```json theme={null}
{
  "status": true,
  "message": "Transaction retrieved",
  "data": {
    "reference": "virtual_account_reference",
    "session_id": "inter_bank_reference",
    "transaction_ref": "inter_bank_reference",
    "amount": 5000,
    "status": "SUCCESS",
    "is_settled": true,
    "method": "TRANSFER",
    "bank": "9PSB",
    "nuban": "0000000000",
    "account_name": "Alias-Ahmad Naziru",
    "customer": "customer@example.com",
    "email": "customer@example.com",
    "created_at": "2024-04-02 05:47:42"
  }
}
```

### Response fields

| Field                          | Description                                                               |
| ------------------------------ | ------------------------------------------------------------------------- |
| `data.reference`               | The reference of the virtual account the payment came into.               |
| `data.session_id`              | The session id you queried with.                                          |
| `data.transaction_ref`         | The interbank reference for the transaction (same value as `session_id`). |
| `data.amount`                  | The amount received.                                                      |
| `data.status`                  | Transaction status (for example `SUCCESS`, `PENDING`, `FAILED`).          |
| `data.is_settled`              | Whether the funds have been settled to your balance.                      |
| `data.method`                  | How the payment was made.                                                 |
| `data.bank`                    | The bank that received the payment.                                       |
| `data.nuban`                   | The virtual account number that received the payment.                     |
| `data.account_name`            | The name on the virtual account.                                          |
| `data.customer` / `data.email` | The customer the virtual account belongs to.                              |
| `data.created_at`              | When the payment was received.                                            |

<Note>
  Transactions are scoped to your business : you can only retrieve transactions that belong to your own virtual accounts.
</Note>
