Skip to main content
GET
/
api
/
orders
curl -X GET "https://api.gatepass.io/api/orders?status=COMPLETED&limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "orders": [
    {
      "id": "clx1234567890abcdef",
      "totalAmount": 102.50,
      "quantity": 2,
      "currency": "NGN",
      "paymentMethod": "FIAT",
      "paymentStatus": "COMPLETED",
      "customerEmail": "[email protected]",
      "customerName": "John Doe",
      "event": {
        "id": "clx1234567890",
        "title": "Tech Conference 2024",
        "venue": "Convention Center Lagos",
        "eventDate": "2024-06-15T10:00:00Z",
        "imageUrl": "https://cdn.gatepass.io/events/tech-conf-2024.jpg"
      },
      "createdAt": "2024-05-20T14:30:00Z",
      "updatedAt": "2024-05-20T14:35:00Z"
    },
    {
      "id": "clx0987654321fedcba",
      "totalAmount": 51.25,
      "quantity": 1,
      "currency": "NGN",
      "paymentMethod": "FIAT",
      "paymentStatus": "COMPLETED",
      "customerEmail": "[email protected]",
      "customerName": "John Doe",
      "event": {
        "id": "clx0987654321",
        "title": "Music Festival 2024",
        "venue": "Eko Atlantic",
        "eventDate": "2024-07-20T18:00:00Z",
        "imageUrl": "https://cdn.gatepass.io/events/music-fest-2024.jpg"
      },
      "createdAt": "2024-05-18T10:15:00Z",
      "updatedAt": "2024-05-18T10:20:00Z"
    }
  ],
  "total": 15,
  "hasMore": false
}
Retrieve all orders made by the authenticated user, including order details, payment status, and associated event information.

Authentication

Authorization
string
required
Bearer token for authentication

Query Parameters

status
string
Filter orders by payment status: PENDING, COMPLETED, or FAILED
eventId
string
Filter orders for a specific event
limit
number
default:"50"
Maximum number of orders to return (1-100)
offset
number
default:"0"
Number of orders to skip for pagination
sortBy
string
default:"createdAt"
Field to sort by: createdAt, totalAmount, or updatedAt
order
string
default:"desc"
Sort order: asc or desc

Response

orders
array
Array of order objects
total
number
Total number of orders matching the query
hasMore
boolean
Whether more orders are available for pagination
curl -X GET "https://api.gatepass.io/api/orders?status=COMPLETED&limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "orders": [
    {
      "id": "clx1234567890abcdef",
      "totalAmount": 102.50,
      "quantity": 2,
      "currency": "NGN",
      "paymentMethod": "FIAT",
      "paymentStatus": "COMPLETED",
      "customerEmail": "[email protected]",
      "customerName": "John Doe",
      "event": {
        "id": "clx1234567890",
        "title": "Tech Conference 2024",
        "venue": "Convention Center Lagos",
        "eventDate": "2024-06-15T10:00:00Z",
        "imageUrl": "https://cdn.gatepass.io/events/tech-conf-2024.jpg"
      },
      "createdAt": "2024-05-20T14:30:00Z",
      "updatedAt": "2024-05-20T14:35:00Z"
    },
    {
      "id": "clx0987654321fedcba",
      "totalAmount": 51.25,
      "quantity": 1,
      "currency": "NGN",
      "paymentMethod": "FIAT",
      "paymentStatus": "COMPLETED",
      "customerEmail": "[email protected]",
      "customerName": "John Doe",
      "event": {
        "id": "clx0987654321",
        "title": "Music Festival 2024",
        "venue": "Eko Atlantic",
        "eventDate": "2024-07-20T18:00:00Z",
        "imageUrl": "https://cdn.gatepass.io/events/music-fest-2024.jpg"
      },
      "createdAt": "2024-05-18T10:15:00Z",
      "updatedAt": "2024-05-18T10:20:00Z"
    }
  ],
  "total": 15,
  "hasMore": false
}

Pagination

Use the limit and offset parameters for pagination:
// First page (orders 0-19)
const page1 = await fetch('/api/orders?limit=20&offset=0');

// Second page (orders 20-39)
const page2 = await fetch('/api/orders?limit=20&offset=20');

// Third page (orders 40-59)
const page3 = await fetch('/api/orders?limit=20&offset=40');
The hasMore field indicates whether additional orders are available. Use this to implement “Load More” or infinite scroll features.

Order Status Values

  • PENDING: Order created, payment not yet completed
  • COMPLETED: Payment successful, tickets issued
  • FAILED: Payment failed or order cancelled

Build docs developers (and LLMs) love