Skip to main content

Overview

The Openfront platform provides GraphQL queries to retrieve customer data, including user information, orders, accounts, and invoices.

Get Customer Orders

Retrieve a list of orders for the authenticated customer.

GraphQL Query

query GetCustomerOrders($limit: Int, $offset: Int) {
  getCustomerOrders(limit: $limit, offset: $offset)
}
limit
Int
Maximum number of orders to return
offset
Int
Number of orders to skip for pagination

Response

Returns a JSON object containing:
orders
array
Array of order objects
id
string
Unique order identifier
displayId
number
Human-readable order number
status
string
Order status (pending, processing, completed, canceled)
total
string
Total order amount
createdAt
string
ISO 8601 timestamp of order creation

Example

query {
  getCustomerOrders(limit: 10, offset: 0)
}

Get Customer Order

Retrieve details for a specific order.

GraphQL Query

query GetCustomerOrder($orderId: ID!, $secretKey: String) {
  getCustomerOrder(orderId: $orderId, secretKey: $secretKey)
}
orderId
ID
required
Unique identifier of the order
secretKey
String
Secret key for guest order access (required for unauthenticated orders)

Response

Returns a JSON object with complete order details:
id
string
Order unique identifier
displayId
number
Human-readable order number
status
string
Current order status
lineItems
array
Array of items in the order
shippingAddress
object
Delivery address details
payments
array
Payment information for the order

Get Customer Accounts

Retrieve business accounts associated with the authenticated customer.

GraphQL Query

query GetCustomerAccounts($limit: Int, $offset: Int) {
  getCustomerAccounts(limit: $limit, offset: $offset)
}
limit
Int
Maximum number of accounts to return
offset
Int
Number of accounts to skip for pagination

Response

accounts
array
Array of business account objects
id
string
Account unique identifier
totalAmount
number
Total outstanding balance
paidAmount
number
Total amount paid
creditLimit
number
Maximum credit limit
currency
object
Account currency details

Get Customer Account

Retrieve details for a specific business account.

GraphQL Query

query GetCustomerAccount($accountId: ID!) {
  getCustomerAccount(accountId: $accountId)
}
accountId
ID
required
Unique identifier of the account

Response

Returns detailed account information including line items and payment history.

Get Customer Paid Invoices

Retrieve paid invoices for the authenticated customer.

GraphQL Query

query GetCustomerPaidInvoices($limit: Int, $offset: Int) {
  getCustomerPaidInvoices(limit: $limit, offset: $offset)
}
limit
Int
Maximum number of invoices to return
offset
Int
Number of invoices to skip for pagination

Response

invoices
array
Array of paid invoice objects
id
string
Invoice unique identifier
status
string
Invoice status
totalAmount
number
Invoice total amount
paidAt
string
Payment timestamp

Standard User Queries

Query users directly using the KeystoneJS GraphQL API:
query GetUsers {
  users {
    id
    name
    email
    phone
    hasAccount
    customerGroups {
      id
      name
    }
    addresses {
      id
      address1
      city
      province
      postalCode
      country {
        iso2
        name
      }
    }
    orders {
      id
      displayId
      status
      total
    }
  }
}

Virtual Fields

firstName
string
Extracted from the user’s full name
lastName
string
Extracted from the user’s full name
activeCartId
string
ID of the user’s current active cart (if exists)
billingAddress
object
Primary billing address

Build docs developers (and LLMs) love