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
Navigate to API Keys
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
- Name: Enter a descriptive name for your API key
- Scopes: Select the permissions you need from the dropdown:
read_products
,write_products
- Product managementread_orders
,write_orders
- Order processingread_customers
,write_customers
- Customer dataread_fulfillments
,write_fulfillments
- Order fulfillmentread_checkouts
,write_checkouts
- Checkout processread_discounts
,write_discounts
- Discount managementread_gift_cards
,write_gift_cards
- Gift card operationsread_returns
,write_returns
- Return processingread_sales_channels
,write_sales_channels
- Sales channelsread_payments
,write_payments
- Payment processingread_webhooks
,write_webhooks
- Webhook managementread_apps
,write_apps
- App integrations
- Expiration (optional): Set an expiration date for the key
- 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
}
}