Skip to main content
GET
/
api
/
v1
/
invoices
List invoices (cursor pagination)
curl --request GET \
  --url https://api-beta.pepay.io/api/v1/invoices \
  --header 'Authorization: Bearer <token>'
{
  "object": "list",
  "data": [
    {
      "object": "invoice",
      "id": "inv_123",
      "merchant_id": 42,
      "status": "paid",
      "invoice_type": "standard",
      "currency": "usd",
      "amount": 129900,
      "amount_decimal": "129.900",
      "amount_unit": "usd_millis",
      "environment": "mainnet",
      "created_at": "2025-01-01T12:00:00Z"
    }
  ],
  "has_more": false
}

Overview

Use this endpoint to list invoices with Stripe-style cursor pagination and optional expand fields.

Authentication

  • Merchant server auth: x-api-key or Authorization: Bearer <jwt>

Request

SDK

const invoices = await pepay.invoices.list({
  limit: 10,
  expand: ['latest_payment']
});

cURL

curl "https://api-beta.pepay.io/api/v1/invoices?limit=10&expand=latest_payment" \
  -H "x-api-key: sk_live_..."

Response

{
  "object": "list",
  "data": [
    {
      "object": "invoice",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "merchant_id": 123,
      "status": "unpaid",
      "invoice_type": "standard",
      "currency": "usd",
      "amount": 49990,
      "amount_decimal": "49.990",
      "amount_unit": "usd_millis",
      "environment": "devnet",
      "created_at": "2025-12-21T12:00:00.000Z"
    }
  ],
  "has_more": false
}

Errors

  • 400 invalid cursor or query parameters
  • 401 missing/invalid merchant auth

Examples

Cursor pagination:
const page1 = await pepay.invoices.list({ limit: 10 });
const last = page1.data?.[page1.data.length - 1];
const page2 = await pepay.invoices.list({ limit: 10, starting_after: last?.id });
Next: Retrieve an invoice

Authorizations

Authorization
string
header
required

JWT token for wallet authentication

Query Parameters

limit
integer
default:10

Max number of invoices to return.

Required range: 1 <= x <= 100
starting_after
string<uuid>

Cursor (return invoices created before this ID).

ending_before
string<uuid>

Cursor (return invoices created after this ID).

status
string

Comma-separated invoice statuses.

invoice_type
string

Comma-separated invoice types.

customer_id
string

Filter by merchant customer ID.

environment
enum<string>

Filter by network environment.

Available options:
mainnet,
devnet
created_gte
string<date-time>

Return invoices created on/after this time.

created_lte
string<date-time>

Return invoices created on/before this time.

expand
string

Comma-separated expansions (latest_payment, payments).

payments_limit
integer
default:10

Max payments per invoice when expand includes payments.

Required range: 1 <= x <= 100

Response

Invoice list retrieved successfully

object
string
Example:

"list"

data
object[]
has_more
boolean