# `Worldpay.PaymentQueries`
[🔗](https://github.com/iamkanishka/worldpay/blob/v1.0.0/lib/worldpay/access/data.ex#L1)

Worldpay **Payment Queries API** — query payment history.

This is an aggregation service with up to 60 seconds of latency.
Not suitable for real-time status checks immediately after payment.

## Query modes

- By date range (from 25 Jun 2024 onward; paginated)
- By `transactionReference`
- By `paymentId` (single payment, full detail)
- Historical (pre-Jun 2024; minimal fields; requires `entityReference`)

# `by_date_range`

```elixir
@spec by_date_range(String.t(), String.t(), Worldpay.Config.t(), keyword()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Query payments by date range.

# `by_id`

```elixir
@spec by_id(String.t(), Worldpay.Config.t()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Retrieve a single payment by `paymentId` (full detail).

# `by_transaction_reference`

```elixir
@spec by_transaction_reference(String.t(), Worldpay.Config.t(), keyword()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Query payments by transaction reference.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
