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

# Payment status (payor)

> Fetch the current payment status for a session.

## Overview

This method is used by payor checkout UIs to determine whether the invoice has been paid, expired, or still requires payment.

## Authentication

Requires `x-session-token` + `x-signature`.

## Request

### Fetch payment status

```ts theme={null}
const status = await pepay.paymentSessions.getPaymentStatus();
```

## Response

```json theme={null}
{
  "status": "unpaid",
  "paid_at": null
}
```

If `status` is `underpaid`, fetch session details to get the locked network/token:

```ts theme={null}
const details = await pepay.paymentSessions.getSessionDetails();
```

## Errors

* `401` invalid session token/signature

## Examples

Poll until paid:

```ts theme={null}
while (true) {
  const s = await pepay.paymentSessions.getPaymentStatus();
  if (s.status === 'paid') break;
  await new Promise((r) => setTimeout(r, 1500));
}
```

Next: [Customer email](/sdk/payors/customer-email)
