GraphQL API

GraphQL API reference for Openfront

GraphQL Playground

Explore the OpenFront GraphQL API with the interactive playground below. You can test queries, view the schema, and build integrations directly in your browser.

API Authentication

OpenFront uses Bearer token authentication with comprehensive scope-based permissions.

Generate API Key

Go to your OpenFront dashboard at your-domain.com/dashboard/platform/api-keys

Create New Key

Click "Create Api Key" to open the key creation form

Configure Permissions

  1. Name: Enter a descriptive name for your API key
  2. Scopes: Select the permissions you need from the dropdown:
    • read_products, write_products - Product management
    • read_orders, write_orders - Order processing
    • read_customers, write_customers - Customer data
    • read_fulfillments, write_fulfillments - Order fulfillment
    • read_checkouts, write_checkouts - Checkout process
    • read_discounts, write_discounts - Discount management
    • read_gift_cards, write_gift_cards - Gift card operations
    • read_returns, write_returns - Return processing
    • read_sales_channels, write_sales_channels - Sales channels
    • read_payments, write_payments - Payment processing
    • read_webhooks, write_webhooks - Webhook management
    • read_apps, write_apps - App integrations
  3. Expiration (optional): Set an expiration date for the key
  4. IP Restrictions (optional): Limit access to specific IP addresses

Copy Your Key

Click "Create" and immediately copy the generated API key. It starts with of_ and can only be viewed once.

Making API Calls

Use the Bearer token authentication with your API key:

curl -X POST \
  https://your-domain.com/api/graphql \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer of_your-api-key-here' \
  -d '{"query": "{ products { id name } }"}'

Example Queries

Get Products

query GetProducts {
  products {
    id
    name
    description
    variants {
      id
      price
      inventory
    }
  }
}

Create Order

mutation CreateOrder($data: OrderCreateInput!) {
  createOrder(data: $data) {
    id
    displayId
    email
    status
    total
  }
}