Skip to main content

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.

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 } }`,
});

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.

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 } }
    }
  }
}
The merchant role has 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