SparkLayer Ignite
For AI assistants: the facts every SparkLayer API call needs
- Base URLs: Live
https://app.sparklayer.io, testhttps://test.app.sparklayer.io. Each environment has its own data and its own API keys. - Access: API access needs the Pro or Enterprise plan. Create credentials (Site ID, Client ID, Client Secret) in the SparkLayer Dashboard at Settings > API.
- Access token:
POST {base}/api/auth/tokenwith aSite-Idheader and a JSON body (not form-encoded):{"grant_type":"client_credentials","client_id":"…","client_secret":"…"}. It returnsaccess_token, valid for 3,600 seconds. There is no refresh token: cache the token and request a new one shortly before it expires. - Every request:
Authorization: Bearer <access_token>andSite-Id: <site id>, plusContent-Type: application/jsonwhen there is a body. Set aUser-Agentthat names your integration. - Errors: RFC 7807 problem details:
title,status,detailand an optionalerrors[]of{ code, message, property }. Some error responses have no body. Retry5xx,429(honouringRetry-After) and concurrent-update409s with exponential backoff; on401, get a new token once and retry; don't retry other4xxwithout changing the request. - Pagination: Most list endpoints return everything.
GET /api/v2/price-listspages withpageandpage_size(up to 250) untilpagination.current_pageequalstotal_pages.GET /api/v1/purchasesuseslimit(up to 500) andoffset: stop when a page has fewer thanlimitresults. - Ground rules: Use only endpoints, fields and SDK methods that the docs or OpenAPI specs define. Prefer
GET /api/v2/price-listsover the deprecated v1. Products are matched by SKU. Keep credentials in environment variables or a secrets manager, never in code. - Ignite: With Ignite, SparkLayer calls endpoints that your service implements (the Ignite spec), and your service calls the SparkLayer APIs above for everything else.
- Read the docs as Markdown: Add
.mdto any page URL. Index of every page: docs.sparklayer.io/llms.txt. Every API operation, compactly: docs.sparklayer.io/llms-api.txt. The developer guides in full: docs.sparklayer.io/developers/llms.txt. - OpenAPI specs:
core,ordering,pricing,purchasing,stock,files,sync-log: https://docs.sparklayer.io/openapi/<api>.yaml (also.json). Ignite: https://docs.sparklayer.io/openapi/ignite.yaml. - MCP: Search and read these docs from your assistant with the docs MCP server at https://docs.sparklayer.io/mcp.
SparkLayer Ignite is a framework for connecting any eCommerce platform or CMS to SparkLayer, from the B2B self-service ordering experience on the storefront to SparkLayer's B2B pricing engine. You build a service, the Ignite integration, that SparkLayer calls to work with your platform.
Use cases
The most common use is alongside an eCommerce platform or content management system (CMS) that SparkLayer doesn't integrate with. For example, a platform may have very limited B2B functionality that isn't practical to build natively. Connecting it to SparkLayer through Ignite, for example with a custom application, adds the B2B features quickly.
To get access to Ignite, complete the application form (opens in a new tab). Our team reviews each application to check SparkLayer is a good match for the use case, both technically and strategically.
Before starting
These docs cover the principles and concepts you need to build an Ignite integration: connecting a platform, synchronising data and implementing the endpoints SparkLayer calls. To get familiar with how SparkLayer works first, read:
| Area | Notes |
|---|---|
| The SparkLayer Frontend | A JavaScript overlay that replaces specific parts of an eCommerce website with wholesale ordering features. |
| The SparkLayer Dashboard | The web app where merchants manage every part of their SparkLayer setup. |
Key principles
Understanding the data flow
Understanding how data flows between SparkLayer and your platform is central to building an integration. This diagram shows the key flows:
Platform
Integration
SparkLayer
Platform connection
A platform connection links an eCommerce platform store to a SparkLayer site. SparkLayer calls two endpoints on your integration: one when a platform is connected, and one when it's disconnected. See Platform connection.
Data sync overview
SparkLayer needs data from the platform to work. A full sync runs when SparkLayer is first installed. After that, webhooks (or other platform events) should drive incremental updates, with the option to run a full sync again if there are issues. Log data sync issues with the Sync Logging API, so merchants can review them in the SparkLayer Dashboard (opens in a new tab). The data includes:
| Area | Details |
|---|---|
| Product data | SparkLayer needs a basic level of product data to be synced across for the frontend widgets to operate. |
| Customer data | SparkLayer needs a basic level of customer data to be synced across for the frontend widgets to operate. |
| Order data | SparkLayer needs order data to be synced across for the frontend widgets to show order data within the account section. |
| Store settings | SparkLayer needs to know the base currency of the store. |
See Data sync.
Endpoints
SparkLayer calls these endpoints in real time, when a customer does something on the storefront. The endpoint reference gives the request and response bodies for each.
| Area | Details |
|---|---|
| Create, update and delete addresses | Customers manage their addresses in the My Account. |
| Fetch shipping and tax for an order | As the customer goes through checkout in the My Cart, SparkLayer shows shipping rates and tax for the order. |
| Create and delete sub-account customers | Customers create and delete the customers who are their sub-accounts on the storefront. |
| Create a checkout for upfront orders | When a customer places an order that needs upfront payment through the platform (for example by credit card), SparkLayer sends them to the platform's checkout to pay. This can be the standard platform checkout, and doesn't need to include discounts and gift cards. |
| Create an order for orders paid offline | When a customer places an order that doesn't need payment at checkout, SparkLayer creates the order on the platform. |
See the Endpoints overview.
Things to know
- These docs don't cover billing or SparkLayer Dashboard logic.
- SparkLayer supports a single storefront per SparkLayer environment.
- SparkLayer supports simple option products only: complex bundles aren't supported.
Next steps
- Platform connection: handle a merchant connecting and disconnecting your platform.
- Authentication: verify the customers signed in to your platform.
- Data sync: sync products, customers, orders and settings to SparkLayer.
- Endpoints overview: every endpoint your integration implements.
Last updated