Skip to main content

Custom Data Integration

The Custom Data Integration gives your developers and data tools broad, read-only access to your Endless data through the Endless GraphQL API. It is designed for reporting, analytics, data warehousing, and other workflows that need to retrieve data without changing anything in Endless.

This guide explains how to create the integration, connect to the API, and find the data you need. The API reference is the source of truth for available queries, fields, filters, types, and response shapes.

What you can use it for

Common uses include:

  • sending Endless data to a data warehouse or business intelligence tool
  • building dashboards and scheduled reports
  • combining product, inventory, order, fulfillment, and supply chain data with data from other systems
  • powering internal tools that only need to view Endless data

The integration provides access through the GraphQL API rather than direct access to the Endless database. It cannot create, update, or delete data. Requests to perform write operations are rejected by the integration's permissions.

The API reference is the source of truth

The examples in this guide explain the connection and authentication process. Before building a query, use the API reference to confirm its current name, arguments, fields, and pagination requirements. This prevents an integration from depending on an example that may no longer match the API.

Create the integration

You need permission to manage integrations for your company.

  1. In Endless, open Integrations.
  2. Select Add integration.
  3. Under Custom Integrations, select Custom Data Integration.
  4. Give the integration a name that identifies the system or workflow that will use it.
  5. Select Create & generate credentials.
  6. Save the generated credentials in a password manager or secrets vault before closing the window.

Endless generates an access token, API key, and API secret. The access token is the credential used to authenticate the GraphQL requests described in this guide. The API key and API secret are only displayed when the integration is created or its credentials are regenerated, so save all three values when they are shown.

Create a separate integration for each system or workflow when practical. Separate credentials make it easier to rotate or revoke one connection without interrupting the others.

Connect to the GraphQL API

Send GraphQL requests as HTTP POST requests to the endpoint shown with the integration. The production endpoint is:

https://api.endlesscommerce.com/graphql

Include these headers:

HeaderValueWhen to include it
Content-Typeapplication/jsonEvery request
X-EC-Access-TokenThe integration's access tokenEvery request
X-Company-IdYour Endless company ID or handleEvery request

Test the connection

The following request checks the endpoint, credentials, and company context without depending on a particular part of the Endless schema:

curl --request POST \
--url https://api.endlesscommerce.com/graphql \
--header 'Content-Type: application/json' \
--header 'X-EC-Access-Token: YOUR_ACCESS_TOKEN' \
--header 'X-Company-Id: YOUR_COMPANY_ID' \
--data '{"query":"query ConnectionCheck { __typename }"}'

A successful response looks like this:

{
"data": {
"__typename": "Query"
}
}

This confirms that the connection works. It does not confirm that a particular data query has the correct fields or arguments.

Build your first data query

Use the API reference to build queries against the current schema:

  1. Open Queries and find the resource you want to retrieve.
  2. Review the query's description, required arguments, and return type.
  3. Follow the linked return types to choose only the fields you need.
  4. If the query returns a connection, use its documented pagination fields and arguments.
  5. Start with a small page of results, then add filters and pagination for your use case.

GraphQL returns only the fields requested by the client. Keeping queries narrow makes them easier to understand and reduces the amount of data each request needs to load and transfer.

When using variables, send the query and variables as separate JSON properties. This schema-independent example looks up a GraphQL type by name:

{
"query": "query InspectType($name: String!) { __type(name: $name) { name kind } }",
"variables": {
"name": "Query"
}
}

Use the same request structure with a data query from the API reference.

Paginate and filter your requests

Data queries may return more records than a single request should load. For reliable integrations:

  • request a small page first and increase it only when necessary
  • follow the pagination model documented for the query
  • continue requesting pages until the response indicates there is no next page
  • use filters such as IDs or date ranges when the query supports them
  • avoid deeply nested queries that retrieve large collections at several levels

Do not assume that every query supports the same filters or pagination arguments. Confirm them in the API reference.

Handle responses safely

A GraphQL response can contain a data property, an errors property, or both. Always inspect errors before treating a request as successful. Log enough context to diagnose a failure, but never log the access token, API key, or API secret.

The API schema can gain new fields over time. Clients should ignore fields they do not request and should handle nullable fields according to the types in the API reference.

Protect and rotate credentials

Treat the credentials like passwords:

  • store them in a secrets vault or password manager
  • use them from a trusted server or data platform, not public browser code
  • never commit them to source control or include them in support messages
  • give credentials only to the people and systems that need them

To rotate credentials, open the integration in Endless and select Regenerate credentials. Regeneration immediately stops the previous credentials from working, so deploy the new access token to the connected system as part of the same change.

Troubleshooting

ProblemWhat to check
The request is unauthorizedConfirm that X-EC-Access-Token contains the access token, with no Bearer prefix, and that the credentials have not been regenerated.
The connection test works but a data query failsCompare the query with the current API reference and confirm all required arguments and fields.
A query returns no data or less data than expectedConfirm X-Company-Id and review the query's filters.
A mutation or other write operation is deniedThis is expected. The integration only has permission to read data.
A query is slow or too largeRequest fewer fields, use a smaller page, add supported filters, and avoid large nested collections.
A field is nullCheck whether the field is nullable in the API reference and whether the underlying record contains that information.

Getting help

Endless Support can help with enabling access, credentials, company scope, and behavior that does not match the current API reference. Designing custom queries, reports, data models, or third-party pipelines is the responsibility of your technical team or implementation partner.

When reporting an API problem, include:

  • the integration name
  • the request time and time zone
  • the GraphQL operation name
  • the error message and response
  • a sanitized copy of the query and variables
  • the company handle used for the request

Never include credentials in a support request.