Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.waffo.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Waffo Pancake GraphQL API provides read-only access to all your data. Use REST action endpoints for writes, and GraphQL for queries.
POST /v1/graphql
Authentication: API Key
The GraphQL API supports queries only. All write operations (create, update, delete) use the REST action endpoints.
Query depth limit: Maximum nesting depth is 7 levels. Exceeding this returns 400.Depth is counted from the root query field. Each nested object selection increases the depth by 1. Scalar fields do not add depth — only object/list fields that contain sub-selections count.
query {                                    # depth 1
  orders {                                 # depth 2
    id                                     # (scalar, no depth increase)
    payments {                             # depth 3
      id
      refunds {                            # depth 4
        id
        refundTicket {                     # depth 5
          id
          versions {                       # depth 6
            id
            reviewedByMerchant {           # depth 7 (limit)
              id                           # OK -- scalar at depth 7
              # store { ... }              # Would be depth 8 -- REJECTED
            }
          }
        }
      }
    }
  }
}
If your query exceeds the limit, simplify by splitting it into multiple queries or removing unnecessary nesting levels.

Making a Request

Request Body

FieldTypeRequiredDescription
querystringYesGraphQL query string
variablesobjectNoQuery variables
import { WaffoPancake } from "@waffo/pancake-ts";

const client = new WaffoPancake({
  merchantId: process.env.WAFFO_MERCHANT_ID!,
  privateKey: process.env.WAFFO_PRIVATE_KEY!,
});

interface StoresQuery {
  stores: Array<{ id: string; name: string; status: string }>;
}

const result = await client.graphql.query<StoresQuery>({
  query: `{ stores { id name status } }`,
});
console.log(result.stores);
// => [{ id: "STO_2aUyqjCzEIiEcYMKj7TZtw", name: "My Store", status: "active" }]

Status Codes

StatusDescription
200Query succeeded (GraphQL errors in response body errors field)
400Missing query / depth exceeded / invalid environment / missing or invalid role
401Authentication failed
403Operation type not allowed (only Query supported)
500Internal server error

Schema Introspection

Recommended: Use standard GraphQL introspection to discover the full schema. This ensures you always work with the latest types and fields.
GraphQL types differ from REST/SDK types. For example, prices is a Record<string, PriceInfo> in REST but [CurrencyPrice!]! (array of {currency, priceInfo}) in GraphQL, and metadata is a parsed object in REST but a JSON string in GraphQL. Do not use SDK TypeScript type definitions to construct GraphQL queries — always use introspection or the examples below.

Discover All Available Queries

query {
  __schema {
    queryType {
      fields {
        name
        description
        args {
          name
          type { name kind }
        }
      }
    }
  }
}

Discover Type Fields

query {
  __type(name: "Store") {
    name
    fields {
      name
      type { name kind ofType { name } }
    }
  }
}
API Key authentication gives you access to 18 query types including single-entity queries, list queries with filters, count queries, and analytics queries.

Filtering

GraphQL queries support filters using typed filter objects:
TypeOperatorsExample
StringFiltereq, ne, in, contains{ storeId: { eq: "STO_xxx" } }
DateTimeFiltereq, gt, lt, gte, lte{ createdAt: { gte: "2026-01-01" } }
IntFiltereq, gt, lt, gte, lte{ amount: { gte: 1000 } }
BooleanFiltereq{ isActive: { eq: true } }
query {
  onetimeProducts(
    filter: {
      storeId: { eq: "STO_3bVzrkD0FJjFdZNLk8Ualx" }
      status: { eq: "active" }
    }
  ) {
    id
    name
    prices
  }
}

Pagination

Use limit and offset for pagination. Use *Count queries to get total counts.
query {
  onetimeProducts(
    filter: { storeId: { eq: "STO_3bVzrkD0FJjFdZNLk8Ualx" } }
    limit: 10
    offset: 0
  ) {
    id
    name
  }
  onetimeProductsCount(
    filter: { storeId: { eq: "STO_3bVzrkD0FJjFdZNLk8Ualx" } }
  )
}
ParameterTypeDescription
limitintegerMaximum number of results to return
offsetintegerNumber of results to skip

Environment-Specific Fields

The API Key environment affects which product data is returned:
  • version — Returns the version for the specified environment
  • status — Returns the status in the specified environment
A product may be active in test but inactive in production if it hasn’t been published yet.

Query Examples

Stores & Products

Query stores, one-time products, subscription products, and product versions

Orders & Payments

Query orders, subscription orders, payments, and refund tickets

Analytics

Revenue statistics, payment analytics, trend analysis, and customer insights