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

# Payment Status

> Check the status of a Vaayu transaction.

After creating a payment, use the transaction hash to determine whether the payment is still processing or has completed.

## Transaction lifecycle

```text theme={null}
pending
   │
   ├──→ confirmed
   │
   └──→ failed
```

### `pending`

The payment has been created but has not reached a final state.

### `confirmed`

The payment completed successfully.

### `failed`

The payment could not be completed.

## Get a transaction

Use the transaction endpoint with the transaction hash returned when the payment was created.

```bash theme={null}
curl -X GET "https://vaayuapi.onrender.com/transaction/0x..."   -H "accept: application/json"   -H "x-api-key: sk_test_xxxxxxxxxxxxxxxxxxxx"
```

Replace `0x...` with the actual transaction hash.

## Example response

```json theme={null}
{
  "tx_hash": "0x...",
  "amount": 100,
  "status": "confirmed"
}
```

## Polling vs webhooks

### Webhooks

Vaayu can notify your server when a transaction changes.

```text theme={null}
Vaayu
  │
  │ event
  ↓
Your webhook endpoint
  │
  ↓
Update your database
```

### Polling

Your application can query the transaction endpoint when it needs the current status.

Polling can be useful for reconciliation, recovery after a missed webhook, manual checks, and development.

## Recommended approach

For a robust integration, use both:

```text theme={null}
Create payment
      ↓
Store tx_hash
      ↓
Wait for webhook
      ↓
Update your database
      ↓
If necessary → GET /transaction/{tx_hash}
```

## Do not assume success

A successful HTTP response from `/send-payment` means the payment request was accepted. It does not necessarily mean the payment has reached its final state.

Always use the transaction status before treating a payment as completed.

<Note>
  Keep the transaction hash in your own database. It is the key reference you can use to reconcile the payment later.
</Note>

<CardGroup cols={2}>
  <Card title="Direct Payments" icon="arrow-right">
    Create a payment and receive its transaction hash.
  </Card>

  <Card title="Webhooks" icon="webhook">
    Receive transaction updates automatically.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.